Make Geo::BaseSyncService#lease_key public

parent ba96f077
......@@ -21,6 +21,10 @@ module Geo
end
end
def lease_key
@lease_key ||= "#{LEASE_KEY_PREFIX}:#{type}:#{project.id}"
end
private
def registry
......@@ -64,10 +68,6 @@ module Geo
registry.update!(attrs)
end
def lease_key
@lease_key ||= "#{LEASE_KEY_PREFIX}:#{type}:#{project.id}"
end
def type
self.class.type
end
......
......@@ -8,7 +8,7 @@ RSpec.describe Geo::RepositorySyncService, services: true do
before do
allow(Gitlab::ExclusiveLease).to receive(:new)
.with(subject.__send__(:lease_key), anything)
.with(subject.lease_key, anything)
.and_return(lease)
allow_any_instance_of(Repository).to receive(:fetch_geo_mirror)
......
......@@ -8,7 +8,7 @@ RSpec.describe Geo::WikiSyncService, services: true do
before do
allow(Gitlab::ExclusiveLease).to receive(:new)
.with(subject.__send__(:lease_key), anything)
.with(subject.lease_key, anything)
.and_return(lease)
allow_any_instance_of(Repository).to receive(:fetch_geo_mirror)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment