From b2959c4102b411c9e078ea21fd4b2f5411932290 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 9 Apr 2014 15:09:11 +0200 Subject: Remove archives older than 2 hours. --- app/models/repository.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models') 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 -- cgit v1.2.1