lib/dirty_pipeline/transaction.rb in dirty_pipeline-0.8.3 vs lib/dirty_pipeline/transaction.rb in dirty_pipeline-0.9.0

- old
+ new

@@ -10,19 +10,18 @@ def call pipeline.schedule_cleanup # Split attempts config and event dispatching - destination, action, max_attempts_count = - pipeline.find_transition(event.transition) - .values_at(:to, :action, :attempts) + action, max_attempts_count = + pipeline.find_transition!(event).values_at(:action, :attempts) storage.commit!(event) # FIXME: make configurable, now - hardcoded to AR API # subject.transaction(requires_new: true) do subject.transaction do - with_abort_handling { yield(destination, action, *event.args) } + with_abort_handling { yield(action, *event.args) } end rescue => exception event.link_exception(exception) if max_attempts_count.to_i > event.attempts_count event.retry!