Commit bacd2c4f authored by James Lopez's avatar James Lopez
Browse files

some refactoring - renaming things, etc..

parent 98f43add5f6b
......@@ -350,8 +350,8 @@ def trending(since = 1.month.ago)
end
# Deletes gitlab project export files older than 24 hours
def archive_gitlab_exports!
Gitlab::Popen.popen(%W(find #{export_path} -not -path #{export_path} -mmin +1440 -delete))
def remove_gitlab_exports!
Gitlab::Popen.popen(%W(find #{Gitlab::ImportExport.storage_path} -not -path #{Gitlab::ImportExport.storage_path} -mmin +1440 -delete))
end
end
......@@ -1111,6 +1111,6 @@ def add_export_job(current_user_id:)
end
def export_path
File.join(ImportExport.storage_path, path_with_namespace)
File.join(Gitlab::ImportExport.storage_path, path_with_namespace)
end
end
class GitlabProjectArchiveWorker
class GitlabRemoveProjectExportWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform
Project.archive_gitlab_exports!
Project.remove_gitlab_exports!
end
end
......@@ -288,9 +288,9 @@ def host(url)
Settings.cron_jobs['repository_archive_cache_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['repository_archive_cache_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'RepositoryArchiveCacheWorker'
Settings.cron_jobs['gitlab_project_archive_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['gitlab_project_archive_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['gitlab_project_archive_worker']['job_class'] = 'GitlabProjectArchiveWorker'
Settings.cron_jobs['gitlab_remove_project_export_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['gitlab_remove_project_export_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['gitlab_remove_project_export_worker']['job_class'] = 'GitlabRemoveProjectExportWorker'
#
# GitLab Shell
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment