Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1695d791
Commit
1695d791
authored
Jun 21, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Geo::DeletedProject to take place of "FakeProject" used by Geo
parent
6340e1e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
app/models/geo/deleted_project.rb
app/models/geo/deleted_project.rb
+13
-0
app/workers/geo_repository_destroy_worker.rb
app/workers/geo_repository_destroy_worker.rb
+1
-7
No files found.
app/models/geo/deleted_project.rb
0 → 100644
View file @
1695d791
class
Geo::DeletedProject
<
::
Project
after_initialize
:readonly!
attr_reader
:path_with_namespace
def
initialize
(
id
:,
name
:,
path_with_namespace
:,
repository_storage:
'default'
)
super
(
id:
id
,
name:
name
,
repository_storage:
repository_storage
)
@path_with_namespace
=
path_with_namespace
end
def
repository
@repository
||=
Repository
.
new
(
path_with_namespace
,
self
)
end
end
app/workers/geo_repository_destroy_worker.rb
View file @
1695d791
...
@@ -5,14 +5,8 @@ class GeoRepositoryDestroyWorker
...
@@ -5,14 +5,8 @@ class GeoRepositoryDestroyWorker
def
perform
(
id
,
name
,
path_with_namespace
)
def
perform
(
id
,
name
,
path_with_namespace
)
# We don't have access to the original model anymore, so we are
# We don't have access to the original model anymore, so we are
# rebuilding only what our service class requires
# rebuilding only what our service class requires
project
=
FakeProject
.
new
(
id
,
name
,
path_with_namespace
)
project
=
::
Geo
::
DeletedProject
.
new
(
id:
id
,
name:
name
,
path_with_namespace:
path_with_namespace
)
::
Projects
::
DestroyService
.
new
(
project
,
nil
).
geo_replicate
::
Projects
::
DestroyService
.
new
(
project
,
nil
).
geo_replicate
end
end
FakeProject
=
Struct
.
new
(
:id
,
:name
,
:path_with_namespace
)
do
def
repository
@repository
||=
Repository
.
new
(
path_with_namespace
,
self
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment