Sha256: 85bf348d09a24892b2b5bbe9287a06672045cc5442ca28eb982c884b7d4c0124
Contents?: true
Size: 611 Bytes
Versions: 14
Compression:
Stored size: 611 Bytes
Contents
module Dynflow module Executors require 'dynflow/executors/abstract' require 'dynflow/executors/parallel' # Every time we run a code that can be defined outside of Dynflow, # we should wrap it with this method, and we can ensure here to do # necessary cleanup, such as cleaning ActiveRecord connections def self.run_user_code clear_connections = defined?(::ActiveRecord) && ActiveRecord::Base.connected? && ActiveRecord::Base.connection.open_transactions.zero? yield ensure ::ActiveRecord::Base.clear_active_connections! if clear_connections end end end
Version data entries
14 entries across 14 versions & 1 rubygems