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
83969dae
Commit
83969dae
authored
Jun 22, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Geo-specific deleted events into its own datastore class
parent
2083d367
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
14 deletions
+31
-14
app/services/ee/projects/destroy_service.rb
app/services/ee/projects/destroy_service.rb
+3
-14
app/services/geo/repository_deleted_event_store.rb
app/services/geo/repository_deleted_event_store.rb
+28
-0
No files found.
app/services/ee/projects/destroy_service.rb
View file @
83969dae
...
...
@@ -10,20 +10,9 @@ module EE
end
def
log_geo_event
(
project
)
return
unless
::
Gitlab
::
Geo
.
primary?
Geo
::
EventLog
.
transaction
do
event_log
=
Geo
::
EventLog
.
new
deleted_event
=
Geo
::
RepositoryDeletedEvent
.
new
(
project:
project
,
repository_storage_name:
project
.
repository
.
storage
,
repository_storage_path:
project
.
repository_storage_path
,
deleted_path:
repo_path
,
deleted_wiki_path:
wiki_path
,
deleted_project_name:
project
.
name
)
event_log
.
repository_deleted_event
=
deleted_event
event_log
.
save
end
::
Geo
::
RepositoryDeletedEventStore
.
new
(
project
,
repo_path:
repo_path
,
wiki_path:
wiki_path
).
create
end
# Removes physical repository in a Geo replicated secondary node
...
...
app/services/geo/repository_deleted_event_store.rb
0 → 100644
View file @
83969dae
module
Geo
class
RepositoryDeletedEventStore
attr_reader
:project
,
:repo_path
,
:wiki_path
def
initialize
(
project
,
repo_path
:,
wiki_path
:)
@project
=
project
@repo_path
=
repo_path
@wiki_path
=
wiki_path
end
def
create
return
unless
Gitlab
::
Geo
.
primary?
Geo
::
EventLog
.
transaction
do
event_log
=
Geo
::
EventLog
.
new
deleted_event
=
Geo
::
RepositoryDeletedEvent
.
new
(
project:
project
,
repository_storage_name:
project
.
repository
.
storage
,
repository_storage_path:
project
.
repository_storage_path
,
deleted_path:
repo_path
,
deleted_wiki_path:
wiki_path
,
deleted_project_name:
project
.
name
)
event_log
.
repository_deleted_event
=
deleted_event
event_log
.
save
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