summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-04-09 15:09:11 +0200
committerMarin Jankovski <marin@gitlab.com>2014-04-09 15:09:11 +0200
commitb2959c4102b411c9e078ea21fd4b2f5411932290 (patch)
tree8e277d0e6d85715302e58bd1d07c8963c26b934b /app/models
parent71678f08f8b008d06da98fdae1905e1880300c00 (diff)
downloadgitlab-ce-b2959c4102b411c9e078ea21fd4b2f5411932290.tar.gz
Remove archives older than 2 hours.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 35ec84f1651..eadc34127c2 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -215,4 +215,9 @@ class Repository
def last_commit_for_path(sha, path)
commits(sha, path, 1).last
end
+
+ # Remove archives older than 2 hours
+ def clean_old_archives
+ Gitlab::Popen.popen(%W(find #{Gitlab.config.gitlab.repository_downloads_path} -mmin +120 -delete))
+ end
end