Commit cc9468e4 authored by Kim Carlbäcker's avatar Kim Carlbäcker Committed by Robert Speicher

Move GC/Repack to OptOut

parent 41eab9a9
...@@ -29,7 +29,7 @@ class GitGarbageCollectWorker ...@@ -29,7 +29,7 @@ class GitGarbageCollectWorker
task = task.to_sym task = task.to_sym
cmd = command(task) cmd = command(task)
gitaly_migrate(GITALY_MIGRATED_TASKS[task]) do |is_enabled| gitaly_migrate(GITALY_MIGRATED_TASKS[task], status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled if is_enabled
gitaly_call(task, project.repository.raw_repository) gitaly_call(task, project.repository.raw_repository)
else else
...@@ -114,8 +114,8 @@ class GitGarbageCollectWorker ...@@ -114,8 +114,8 @@ class GitGarbageCollectWorker
%W[git -c repack.writeBitmaps=#{config_value}] %W[git -c repack.writeBitmaps=#{config_value}]
end end
def gitaly_migrate(method, &block) def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block)
Gitlab::GitalyClient.migrate(method, &block) Gitlab::GitalyClient.migrate(method, status: status, &block)
rescue GRPC::NotFound => e rescue GRPC::NotFound => e
Gitlab::GitLogger.error("#{method} failed:\nRepository not found") Gitlab::GitLogger.error("#{method} failed:\nRepository not found")
raise Gitlab::Git::Repository::NoRepository.new(e) raise Gitlab::Git::Repository::NoRepository.new(e)
......
...@@ -104,7 +104,7 @@ describe GitGarbageCollectWorker do ...@@ -104,7 +104,7 @@ describe GitGarbageCollectWorker do
it_should_behave_like 'flushing ref caches', true it_should_behave_like 'flushing ref caches', true
end end
context "with Gitaly turned off", :skip_gitaly_mock do context "with Gitaly turned off", :disable_gitaly do
it_should_behave_like 'flushing ref caches', false it_should_behave_like 'flushing ref caches', false
end end
......
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