mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 22:59:19 +10:00
fixing more export problems
This commit is contained in:
@@ -27,7 +27,7 @@ module Projects
|
||||
end
|
||||
|
||||
def notify_worker
|
||||
raise Gitlab::ImportExport::Error @shared.errors.join(', ')
|
||||
raise Gitlab::ImportExport::Error.new(@shared.errors.join(', '))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
class ProjectExportWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
# TODO: enabled retry - disabled for QA purposes
|
||||
# TODO: enable retry - disabled for QA purposes
|
||||
sidekiq_options queue: :gitlab_shell, retry: false
|
||||
|
||||
def perform(current_user_id, project_id)
|
||||
current_user = User.find(current_user_id)
|
||||
project = Project.find(project_id)
|
||||
::Projects::ImportExport::ExportService.new(project, current_user).execute
|
||||
# TODO : Handle errors
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ module Gitlab
|
||||
|
||||
def save
|
||||
if compress_and_save
|
||||
remove_storage_path
|
||||
remove_export_path
|
||||
Rails.logger.info("Saved project export #{archive_file}")
|
||||
archive_file
|
||||
else
|
||||
@@ -27,15 +27,15 @@ module Gitlab
|
||||
private
|
||||
|
||||
def compress_and_save
|
||||
tar_czf(archive: archive_file, dir: @shared.storage_path)
|
||||
tar_czf(archive: archive_file, dir: @shared.export_path)
|
||||
end
|
||||
|
||||
def remove_storage_path
|
||||
FileUtils.rm_rf(@shared.storage_path)
|
||||
def remove_export_path
|
||||
FileUtils.rm_rf(@shared.export_path)
|
||||
end
|
||||
|
||||
def archive_file
|
||||
@archive_file ||= File.join(@shared.storage_path, '..', "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_project_export.tar.gz")
|
||||
@archive_file ||= File.join(@shared.export_path, '..', "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_project_export.tar.gz")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user