1 class JobTask < ArvadosModel
4 include CommonApiTemplate
5 serialize :parameters, Hash
6 after_update :delete_created_job_tasks_if_failed
7 after_update :assign_created_job_tasks_qsequence_if_succeeded
9 api_accessible :user, extend: :common do |t|
11 t.add :created_by_job_task_uuid
22 def delete_created_job_tasks_if_failed
23 if self.success == false and self.success != self.success_was
24 JobTask.delete_all ['created_by_job_task_uuid = ?', self.uuid]
28 def assign_created_job_tasks_qsequence_if_succeeded
29 if self.success == false and self.success != self.success_was
30 # xxx qsequence should be sequential as advertised; for now at
31 # least it's non-decreasing.
32 JobTask.update_all(['qsequence = ?', (Time.now.to_f*10000000).to_i],
33 ['created_by_job_task_uuid = ?', self.uuid])