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
8c79d5ee
Commit
8c79d5ee
authored
Nov 07, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GeoRenameRepositoryWorker under Geo namespace
parent
f93a82af
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
app/services/geo/rename_repository_service.rb
app/services/geo/rename_repository_service.rb
+1
-1
app/workers/geo/rename_repository_worker.rb
app/workers/geo/rename_repository_worker.rb
+10
-0
app/workers/geo_rename_repository_worker.rb
app/workers/geo_rename_repository_worker.rb
+0
-8
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
+2
-2
spec/services/geo/rename_repository_service_spec.rb
spec/services/geo/rename_repository_service_spec.rb
+2
-2
No files found.
app/services/geo/rename_repository_service.rb
View file @
8c79d5ee
...
...
@@ -9,7 +9,7 @@ module Geo
end
def
async_execute
GeoRenameRepositoryWorker
.
perform_async
(
project_id
,
old_disk_path
,
new_disk_path
)
Geo
::
RenameRepositoryWorker
.
perform_async
(
project_id
,
old_disk_path
,
new_disk_path
)
end
def
execute
...
...
app/workers/geo/rename_repository_worker.rb
0 → 100644
View file @
8c79d5ee
module
Geo
class
RenameRepositoryWorker
include
Sidekiq
::
Worker
include
GeoQueue
def
perform
(
project_id
,
old_disk_path
,
new_disk_path
)
Geo
::
RenameRepositoryService
.
new
(
project_id
,
old_disk_path
,
new_disk_path
).
execute
end
end
end
app/workers/geo_rename_repository_worker.rb
deleted
100644 → 0
View file @
f93a82af
class
GeoRenameRepositoryWorker
include
Sidekiq
::
Worker
include
GeoQueue
def
perform
(
project_id
,
old_path_with_namespace
,
new_path_with_namespace
)
Geo
::
RenameRepositoryService
.
new
(
project_id
,
old_path_with_namespace
,
new_path_with_namespace
).
execute
end
end
spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
View file @
8c79d5ee
...
...
@@ -204,12 +204,12 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
expect
{
daemon
.
run_once!
}.
not_to
change
(
Geo
::
ProjectRegistry
,
:count
)
end
it
'schedules a GeoRenameRepositoryWorker'
do
it
'schedules a Geo
::
RenameRepositoryWorker'
do
project_id
=
repository_renamed_event
.
project_id
old_path_with_namespace
=
repository_renamed_event
.
old_path_with_namespace
new_path_with_namespace
=
repository_renamed_event
.
new_path_with_namespace
expect
(
::
GeoRenameRepositoryWorker
).
to
receive
(
:perform_async
)
expect
(
::
Geo
::
RenameRepositoryWorker
).
to
receive
(
:perform_async
)
.
with
(
project_id
,
old_path_with_namespace
,
new_path_with_namespace
)
daemon
.
run_once!
...
...
spec/services/geo/rename_repository_service_spec.rb
View file @
8c79d5ee
...
...
@@ -27,13 +27,13 @@ describe Geo::RenameRepositoryService do
subject
(
:service
)
{
described_class
.
new
(
project
.
id
,
project
.
full_path
,
new_path
)
}
it
'starts the worker'
do
expect
(
GeoRenameRepositoryWorker
).
to
receive
(
:perform_async
)
expect
(
Geo
::
RenameRepositoryWorker
).
to
receive
(
:perform_async
)
service
.
async_execute
end
it
'returns job id'
do
allow
(
GeoRenameRepositoryWorker
).
to
receive
(
:perform_async
).
and_return
(
'foo'
)
allow
(
Geo
::
RenameRepositoryWorker
).
to
receive
(
:perform_async
).
and_return
(
'foo'
)
expect
(
service
.
async_execute
).
to
eq
(
'foo'
)
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