Skip to content
Snippets Groups Projects
Commit b2959c41 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Remove archives older than 2 hours.

parent 71678f08
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,6 +16,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
 
storage_path = Gitlab.config.gitlab.repository_downloads_path
 
@repository.clean_old_archives
file_path = @repository.archive_repo(params[:ref], storage_path, params[:format].downcase)
 
if file_path
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment