diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-05-02 21:41:05 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-02 21:41:05 +0000 |
commit | d25239ee0b56a1f7c00d805949d0d0009037ee54 (patch) | |
tree | 1fd3e06bfed0744e4b33f211821abf221763f516 /spec/workers | |
parent | 8163e233252f4335d8b2ccb11ced51a77944ee4d (diff) | |
download | gitlab-ce-d25239ee0b56a1f7c00d805949d0d0009037ee54.tar.gz |
Use git_garbage_collect_worker to run pack_refs
PackRefs is not an expensive gitaly call - we want to
call it more often (than as part of full `gc`) because
it helps to keep number of refs files small - too many
refs file may be a problem for deployments with
slow storage.
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/git_garbage_collect_worker_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/workers/git_garbage_collect_worker_spec.rb b/spec/workers/git_garbage_collect_worker_spec.rb index 2459638c3e6..cc1c23bb9e7 100644 --- a/spec/workers/git_garbage_collect_worker_spec.rb +++ b/spec/workers/git_garbage_collect_worker_spec.rb @@ -115,6 +115,19 @@ describe GitGarbageCollectWorker do end end + context "pack_refs" do + before do + expect(subject).to receive(:get_lease_uuid).and_return(lease_uuid) + end + + it "calls Gitaly" do + expect_any_instance_of(Gitlab::GitalyClient::RefService).to receive(:pack_refs) + .and_return(nil) + + subject.perform(project.id, :pack_refs, lease_key, lease_uuid) + end + end + context "repack_incremental" do before do expect(subject).to receive(:get_lease_uuid).and_return(lease_uuid) |