Commit d7046d7b authored by Peter Leitzen's avatar Peter Leitzen

Merge branch '299903-fj-remove-unnecessary-override' into 'master'

Remove unnecessary override in `Projects::GitGarbageCollectWorker`

See merge request gitlab-org/gitlab!53144
parents c95102ff 64138635
......@@ -7,22 +7,6 @@ module Projects
private
# At the moment this was added, the default key was like this.
# With the addition of wikis to housekeeping, this will bring a
# problem because the wiki for project 1 will have the same
# lease key as project 1.
#
# In the `GitGarbageCollectMethods` we namespaced the resource,
# giving us the option to have different resources. Nevertheless,
# we kept this override in order for backward compatibility and avoid
# starting all projects from scratch.
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/299903
override :default_lease_key
def default_lease_key(task, resource)
"git_gc:#{task}:#{resource.id}"
end
override :find_resource
def find_resource(id)
Project.find(id)
......
......@@ -9,7 +9,7 @@ RSpec.describe Projects::GitGarbageCollectWorker do
let(:resource) { project }
let(:statistics_service_klass) { Projects::UpdateStatisticsService }
let(:statistics_keys) { [:repository_size, :lfs_objects_size] }
let(:expected_default_lease) { "#{resource.id}" }
let(:expected_default_lease) { "projects:#{resource.id}" }
end
context 'when is able to get the lease' do
......
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