summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/shared.rb
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-03-30 15:45:59 +0000
committerDouwe Maan <douwe@gitlab.com>2018-03-30 15:45:59 +0000
commit22b05a1ff74d4f64490f93995259602b3d07c3cf (patch)
treee2e1cff25e9e4ab67252b0402cb5df95fdc98d25 /lib/gitlab/import_export/shared.rb
parent7c36e8561c60882e6b0b47c563f7d19f3d6b02a6 (diff)
downloadgitlab-ce-22b05a1ff74d4f64490f93995259602b3d07c3cf.tar.gz
Extend API for exporting a project with direct upload URL
Diffstat (limited to 'lib/gitlab/import_export/shared.rb')
-rw-r--r--lib/gitlab/import_export/shared.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/shared.rb b/lib/gitlab/import_export/shared.rb
index 3d3d998a6a3..6d7c36ce38b 100644
--- a/lib/gitlab/import_export/shared.rb
+++ b/lib/gitlab/import_export/shared.rb
@@ -22,7 +22,7 @@ module Gitlab
def error(error)
error_out(error.message, caller[0].dup)
- @errors << error.message
+ add_error_message(error.message)
# Debug:
if error.backtrace
@@ -32,6 +32,14 @@ module Gitlab
end
end
+ def add_error_message(error_message)
+ @errors << error_message
+ end
+
+ def after_export_in_progress?
+ File.exist?(after_export_lock_file)
+ end
+
private
def relative_path
@@ -45,6 +53,10 @@ module Gitlab
def error_out(message, caller)
Rails.logger.error("Import/Export error raised on #{caller}: #{message}")
end
+
+ def after_export_lock_file
+ AfterExportStrategies::BaseAfterExportStrategy.lock_file_path(project)
+ end
end
end
end