lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-2.0.3 vs lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-3.0.0

- old
+ new

@@ -6,15 +6,13 @@ class Dynflow::Persistence < ::Dynflow::PersistenceAdapters::Sequel def save_execution_plan(execution_plan_id, value) # clear connection only if not running in some active record transaction already clear_connections = ActiveRecord::Base.connection.open_transactions.zero? super.tap do - begin - on_execution_plan_save(execution_plan_id, value) - rescue => e - Foreman::Logging.exception('Error on on_execution_plan_save event', e, - :logger => 'dynflow') - end + on_execution_plan_save(execution_plan_id, value) + rescue => e + Foreman::Logging.exception('Error on on_execution_plan_save event', e, + :logger => 'dynflow') end ensure ::ActiveRecord::Base.clear_active_connections! if clear_connections end