lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-0.7.10 vs lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-0.7.11
- old
+ new
@@ -23,10 +23,12 @@
def on_execution_plan_save(execution_plan_id, data)
# We can load the data unless the execution plan was properly planned and saved
# including its steps
case data[:state]
when :pending
- ForemanTasks::Task::DynflowTask.new_for_execution_plan(execution_plan_id, data).save!
+ task = ForemanTasks::Task::DynflowTask.new_for_execution_plan(execution_plan_id, data)
+ task.start_at ||= Time.now
+ task.save!
when :scheduled
delayed_plan = load_delayed_plan(execution_plan_id)
raise Foreman::Exception.new('Plan is delayed but the delay record is missing') if delayed_plan.nil?
# TODO: Rework this
delayed_plan = ::Dynflow::DelayedPlan.new_from_hash(ForemanTasks.dynflow.world, delayed_plan)