Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-24 15:15:59 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-31 13:52:20 +0300
commit2cfd0b59aeb410c1541530ca3eb5f5c472b978e0 (patch)
tree6456eb0d262036234c851dd516f3edd12cc0f833 /app/models/repository.rb
parent33a8f53f7a8fdc40d0f0ee4245258c8dba99198a (diff)
Archive repositories in background worker.
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 77765cae1a0..72769498872 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -267,6 +267,9 @@ class Repository
# Remove archives older than 2 hours
def clean_old_archives
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