From cc9468e4fa276cef5673750464889f2d2791a9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Carlb=C3=A4cker?= Date: Wed, 6 Jun 2018 14:28:03 +0000 Subject: [PATCH] Move GC/Repack to OptOut --- app/workers/git_garbage_collect_worker.rb | 6 +++--- spec/workers/git_garbage_collect_worker_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/workers/git_garbage_collect_worker.rb b/app/workers/git_garbage_collect_worker.rb index be4203bc7ad..f3c9e2b1582 100644 --- a/app/workers/git_garbage_collect_worker.rb +++ b/app/workers/git_garbage_collect_worker.rb @@ -29,7 +29,7 @@ class GitGarbageCollectWorker task = task.to_sym 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 gitaly_call(task, project.repository.raw_repository) else @@ -114,8 +114,8 @@ class GitGarbageCollectWorker %W[git -c repack.writeBitmaps=#{config_value}] end - def gitaly_migrate(method, &block) - Gitlab::GitalyClient.migrate(method, &block) + def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block) + Gitlab::GitalyClient.migrate(method, status: status, &block) rescue GRPC::NotFound => e Gitlab::GitLogger.error("#{method} failed:\nRepository not found") raise Gitlab::Git::Repository::NoRepository.new(e) diff --git a/spec/workers/git_garbage_collect_worker_spec.rb b/spec/workers/git_garbage_collect_worker_spec.rb index 74539a7e493..f44b4edc305 100644 --- a/spec/workers/git_garbage_collect_worker_spec.rb +++ b/spec/workers/git_garbage_collect_worker_spec.rb @@ -104,7 +104,7 @@ describe GitGarbageCollectWorker do it_should_behave_like 'flushing ref caches', true 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 end