some refactoring - renaming things, etc..

This commit is contained in:
James Lopez 2016-06-15 09:03:54 +02:00
parent 36ccaca35a
commit bacd2c4fa0
3 changed files with 8 additions and 8 deletions

View file

@ -350,8 +350,8 @@ class Project < ActiveRecord::Base
end end
# Deletes gitlab project export files older than 24 hours # Deletes gitlab project export files older than 24 hours
def archive_gitlab_exports! def remove_gitlab_exports!
Gitlab::Popen.popen(%W(find #{export_path} -not -path #{export_path} -mmin +1440 -delete)) Gitlab::Popen.popen(%W(find #{Gitlab::ImportExport.storage_path} -not -path #{Gitlab::ImportExport.storage_path} -mmin +1440 -delete))
end end
end end
@ -1111,6 +1111,6 @@ class Project < ActiveRecord::Base
end end
def export_path def export_path
File.join(ImportExport.storage_path, path_with_namespace) File.join(Gitlab::ImportExport.storage_path, path_with_namespace)
end end
end end

View file

@ -1,9 +1,9 @@
class GitlabProjectArchiveWorker class GitlabRemoveProjectExportWorker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options queue: :default sidekiq_options queue: :default
def perform def perform
Project.archive_gitlab_exports! Project.remove_gitlab_exports!
end end
end end

View file

@ -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'] ||= Settingslogic.new({})
Settings.cron_jobs['repository_archive_cache_worker']['cron'] ||= '0 * * * *' Settings.cron_jobs['repository_archive_cache_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'RepositoryArchiveCacheWorker' Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'RepositoryArchiveCacheWorker'
Settings.cron_jobs['gitlab_project_archive_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['gitlab_remove_project_export_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['gitlab_project_archive_worker']['cron'] ||= '0 * * * *' Settings.cron_jobs['gitlab_remove_project_export_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['gitlab_project_archive_worker']['job_class'] = 'GitlabProjectArchiveWorker' Settings.cron_jobs['gitlab_remove_project_export_worker']['job_class'] = 'GitlabRemoveProjectExportWorker'
# #
# GitLab Shell # GitLab Shell