Class: RepositoryArchiveCleanUpService
- Inherits:
-
Object
- Object
- RepositoryArchiveCleanUpService
- Defined in:
- app/services/repository_archive_clean_up_service.rb
Overview
RepositoryArchiveCleanUpService removes cached repository archives that are generated on-the-fly by Gitaly. These files are stored in the following form (as defined in lib/gitlab/git/repository.rb) and served by GitLab Workhorse:
/path/to/repository/downloads/project-N/sha/@v2/archive.format
Legacy paths omit the @v2 prefix.
For example:
/var/opt/gitlab/gitlab-rails/shared/cache/archive/project-1/master/@v2/archive.zip
Constant Summary collapse
- LAST_MODIFIED_TIME_IN_MINUTES =
120
- MAX_ARCHIVE_DEPTH =
For ‘/path/project-N/sha/@v2/archive.zip`, `find /path -maxdepth 4` will find this file
4
Instance Attribute Summary collapse
-
#mmin ⇒ Object
readonly
Returns the value of attribute mmin.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(mmin = LAST_MODIFIED_TIME_IN_MINUTES) ⇒ RepositoryArchiveCleanUpService
constructor
A new instance of RepositoryArchiveCleanUpService.
Constructor Details
#initialize(mmin = LAST_MODIFIED_TIME_IN_MINUTES) ⇒ RepositoryArchiveCleanUpService
Returns a new instance of RepositoryArchiveCleanUpService.
23 24 25 26 |
# File 'app/services/repository_archive_clean_up_service.rb', line 23 def initialize(mmin = LAST_MODIFIED_TIME_IN_MINUTES) @mmin = mmin @path = Gitlab.config.gitlab.repository_downloads_path end |
Instance Attribute Details
#mmin ⇒ Object (readonly)
Returns the value of attribute mmin.
21 22 23 |
# File 'app/services/repository_archive_clean_up_service.rb', line 21 def mmin @mmin end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'app/services/repository_archive_clean_up_service.rb', line 21 def path @path end |