diff --git a/app/models/project.rb b/app/models/project.rb index 617dbf9a925..4cffb1b7dc1 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -350,8 +350,8 @@ class Project < ActiveRecord::Base 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 @@ class Project < ActiveRecord::Base end def export_path - File.join(ImportExport.storage_path, path_with_namespace) + File.join(Gitlab::ImportExport.storage_path, path_with_namespace) end end diff --git a/app/workers/gitlab_project_archive_worker.rb b/app/workers/gitlab_remove_project_export_worker.rb similarity index 54% rename from app/workers/gitlab_project_archive_worker.rb rename to app/workers/gitlab_remove_project_export_worker.rb index 63e7086d41a..1d91897d520 100644 --- a/app/workers/gitlab_project_archive_worker.rb +++ b/app/workers/gitlab_remove_project_export_worker.rb @@ -1,9 +1,9 @@ -class GitlabProjectArchiveWorker +class GitlabRemoveProjectExportWorker include Sidekiq::Worker sidekiq_options queue: :default def perform - Project.archive_gitlab_exports! + Project.remove_gitlab_exports! end end diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 64cfc0f5357..7a9aa632fcf 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -288,9 +288,9 @@ Settings.cron_jobs['admin_email_worker']['job_class'] = 'AdminEmailWorker' 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