Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-30 03:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-30 03:09:01 +0300
commit2fdee6d838d5615a24bfde9874a5c2d84a30d5bf (patch)
tree30ed88988118d43562d83ff493c7bee31b0e130c /app/models
parent8308674afc1f8636bcd2017e1573292d1500af9d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_export_job.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/models/project_export_job.rb b/app/models/project_export_job.rb
index decc71ee193..47be692d57a 100644
--- a/app/models/project_export_job.rb
+++ b/app/models/project_export_job.rb
@@ -6,6 +6,13 @@ class ProjectExportJob < ApplicationRecord
validates :project, :jid, :status, presence: true
+ STATUS = {
+ queued: 0,
+ started: 1,
+ finished: 2,
+ failed: 3
+ }.freeze
+
state_machine :status, initial: :queued do
event :start do
transition [:queued] => :started
@@ -19,9 +26,9 @@ class ProjectExportJob < ApplicationRecord
transition [:queued, :started] => :failed
end
- state :queued, value: 0
- state :started, value: 1
- state :finished, value: 2
- state :failed, value: 3
+ state :queued, value: STATUS[:queued]
+ state :started, value: STATUS[:started]
+ state :finished, value: STATUS[:finished]
+ state :failed, value: STATUS[:failed]
end
end