summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTravis Miller <travis@travismiller.com>2018-02-24 23:03:29 -0600
committerTravis Miller <travis@travismiller.com>2018-02-28 20:47:36 -0600
commita4308c53e5db594a6e351b143e11ceba6033cdc7 (patch)
tree371771b0a969a0a9501024b2ffa5b090909557fc /app
parentb20408372b6811520edc3e35702bfe9b053b013b (diff)
downloadgitlab-ce-a4308c53e5db594a6e351b143e11ceba6033cdc7.tar.gz
Add project export API entities
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index ba278a49688..791b69bd9ee 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1567,6 +1567,21 @@ class Project < ActiveRecord::Base
Dir.glob("#{export_path}/*export.tar.gz").max_by { |f| File.ctime(f) }
end
+ def export_status
+ if export_in_progress?
+ :started
+ elsif export_project_path
+ :finished
+ else
+ :none
+ end
+ end
+
+ def export_in_progress?
+ shared = Gitlab::ImportExport::Shared.new(relative_path: File.join(disk_path, 'work'))
+ File.directory?(shared.export_path)
+ end
+
def remove_exports
return nil unless export_path.present?