diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-31 10:57:23 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-31 10:57:23 +0300 |
commit | 15d00fc3d3cfb941a1904840259b719f8bbf4eeb (patch) | |
tree | d13f691e5f53a60f0713d7d334a143f2b82f0973 /lib | |
parent | 6fe736f2c927340ed8cf827080db781f7c8adcdf (diff) | |
parent | 05f90b861fbc60cba1912e6a74cb7a4c126e6b7e (diff) |
Merge branch 'gitaly-398-git-garbage-collect' into 'master'
Migrate GitGarbageCollectWorker to Gitaly
Closes gitaly#398
See merge request !12975
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index f5d84ea8762..13e75b256a7 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -4,12 +4,28 @@ module Gitlab def initialize(repository) @repository = repository @gitaly_repo = repository.gitaly_repository + @storage = repository.storage end def exists? request = Gitaly::RepositoryExistsRequest.new(repository: @gitaly_repo) - GitalyClient.call(@repository.storage, :repository_service, :exists, request).exists + GitalyClient.call(@storage, :repository_service, :exists, request).exists + end + + def garbage_collect(create_bitmap) + request = Gitaly::GarbageCollectRequest.new(repository: @gitaly_repo, create_bitmap: create_bitmap) + GitalyClient.call(@storage, :repository_service, :garbage_collect, request) + end + + def repack_full(create_bitmap) + request = Gitaly::RepackFullRequest.new(repository: @gitaly_repo, create_bitmap: create_bitmap) + GitalyClient.call(@storage, :repository_service, :repack_full, request) + end + + def repack_incremental + request = Gitaly::RepackIncrementalRequest.new(repository: @gitaly_repo) + GitalyClient.call(@storage, :repository_service, :repack_incremental, request) end end end |