Class: Actions::Middleware::RecurringLogic

Inherits:
Dynflow::Middleware
  • Object
show all
Defined in:
app/lib/actions/middleware/recurring_logic.rb

Instance Method Summary collapse

Instance Method Details

#delay(delay_options, *args) ⇒ Object

::Actions::Middleware::RecurringLogic

A middleware designed to make action repeatable. After an action is delayed, it checks whether the delay_options hash contains an id of a recurring logic. If so, it adds the task to the recurring logic’s task group, otherwise does nothing.



10
11
12
13
14
15
16
# File 'app/lib/actions/middleware/recurring_logic.rb', line 10

def delay(delay_options, *args)
  pass(delay_options, *args).tap do
    if delay_options[:recurring_logic_id]
      task.add_missing_task_groups(recurring_logic(delay_options).task_group)
    end
  end
end