X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e2a7fe50d3b6e98b7f549c78c4f91dbe4066ddbb..ef3a7bc786d108f597edfa3f63a1d06752002fd6:/services/api/app/models/pipeline_instance.rb diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb index 185bf02d41..354c8924e7 100644 --- a/services/api/app/models/pipeline_instance.rb +++ b/services/api/app/models/pipeline_instance.rb @@ -8,7 +8,7 @@ class PipelineInstance < ArvadosModel belongs_to :pipeline_template, :foreign_key => :pipeline_template_uuid, :primary_key => :uuid before_validation :bootstrap_components - before_validation :update_success + before_validation :update_state before_validation :verify_status before_create :set_state_before_save before_save :set_state_before_save @@ -78,7 +78,7 @@ class PipelineInstance < ArvadosModel else row << 0.0 if step['failed'] - self.success = false + self.state = Failed end end row << (step['warehousejob']['id'] rescue nil) @@ -109,9 +109,9 @@ class PipelineInstance < ArvadosModel end end - def update_success + def update_state if components and progress_ratio == 1.0 - self.success = true + self.state = Complete end end @@ -158,9 +158,9 @@ class PipelineInstance < ArvadosModel end def set_state_before_save - if self.components_look_ready? && (!self.state || self.state == New) - self.state = Ready - end + if self.components_look_ready? && (!self.state || self.state == New) + self.state = Ready + end end end