diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-21 21:44:53 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-21 21:44:53 +0000 |
commit | d2598f6273d4a714134c26ee520b99a40579e8fa (patch) | |
tree | 49a147aa44b3df4b664c1aecdcbcbb52b88130e9 /app/models/repository.rb | |
parent | 95c4825a456a4d1df8dba1def8735203368356c9 (diff) | |
parent | 3b2c17a9a203aa8e82a3367a77d28eacaa5a0ab7 (diff) | |
download | gitlab-ce-d2598f6273d4a714134c26ee520b99a40579e8fa.tar.gz |
Merge branch 'fix-data-integrity-issue-with-repository-downloads-path' into 'master'
Avoid data-integrity issue when cleaning up repository archive cache
## What does this MR do?
Sets the default value for `repository_downloads_path` if someone has it configured incorrectly, and it points to the path where repositories are stored. It's also replace invocation of `find` with Ruby code that matches old cached files in a better, and safe way to avoid data-integrity issues.
## Why was this MR needed?
The `repository_downloads_path` is used by the `RepositoryArchiveCacheWorker` to remove outdated repository archives, if it points to the wrong directory can cause some data-integrity issue.
## What are the relevant issue numbers?
Closes #14222
See merge request !5285
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 511df2d67c6..a6580e85498 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -11,16 +11,6 @@ class Repository attr_accessor :path_with_namespace, :project - def self.clean_old_archives - Gitlab::Metrics.measure(:clean_old_archives) do - repository_downloads_path = Gitlab.config.gitlab.repository_downloads_path - - return unless File.directory?(repository_downloads_path) - - Gitlab::Popen.popen(%W(find #{repository_downloads_path} -not -path #{repository_downloads_path} -mmin +120 -delete)) - end - end - def initialize(path_with_namespace, project) @path_with_namespace = path_with_namespace @project = project |