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
1c1410c4
Commit
1c1410c4
authored
Jul 06, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Geo::BaseSyncService#lease_key public
parent
ba96f077
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/services/geo/base_sync_service.rb
app/services/geo/base_sync_service.rb
+4
-4
spec/services/geo/repository_sync_service_spec.rb
spec/services/geo/repository_sync_service_spec.rb
+1
-1
spec/services/geo/wiki_sync_service_spec.rb
spec/services/geo/wiki_sync_service_spec.rb
+1
-1
No files found.
app/services/geo/base_sync_service.rb
View file @
1c1410c4
...
@@ -21,6 +21,10 @@ module Geo
...
@@ -21,6 +21,10 @@ module Geo
end
end
end
end
def
lease_key
@lease_key
||=
"
#{
LEASE_KEY_PREFIX
}
:
#{
type
}
:
#{
project
.
id
}
"
end
private
private
def
registry
def
registry
...
@@ -64,10 +68,6 @@ module Geo
...
@@ -64,10 +68,6 @@ module Geo
registry
.
update!
(
attrs
)
registry
.
update!
(
attrs
)
end
end
def
lease_key
@lease_key
||=
"
#{
LEASE_KEY_PREFIX
}
:
#{
type
}
:
#{
project
.
id
}
"
end
def
type
def
type
self
.
class
.
type
self
.
class
.
type
end
end
...
...
spec/services/geo/repository_sync_service_spec.rb
View file @
1c1410c4
...
@@ -8,7 +8,7 @@ RSpec.describe Geo::RepositorySyncService, services: true do
...
@@ -8,7 +8,7 @@ RSpec.describe Geo::RepositorySyncService, services: true do
before
do
before
do
allow
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:new
)
allow
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:new
)
.
with
(
subject
.
__send__
(
:lease_key
)
,
anything
)
.
with
(
subject
.
lease_key
,
anything
)
.
and_return
(
lease
)
.
and_return
(
lease
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
)
...
...
spec/services/geo/wiki_sync_service_spec.rb
View file @
1c1410c4
...
@@ -8,7 +8,7 @@ RSpec.describe Geo::WikiSyncService, services: true do
...
@@ -8,7 +8,7 @@ RSpec.describe Geo::WikiSyncService, services: true do
before
do
before
do
allow
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:new
)
allow
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:new
)
.
with
(
subject
.
__send__
(
:lease_key
)
,
anything
)
.
with
(
subject
.
lease_key
,
anything
)
.
and_return
(
lease
)
.
and_return
(
lease
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
)
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
)
...
...
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