Merge branch 'gitaly-gc-repack-opt-out' into 'master'
Move GC/Repack to OptOut See merge request gitlab-org/gitlab-ce!19381
This commit is contained in:
commit
005bc94447
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
%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
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue