lib/capistrano/configuration/execution.rb
# Invoke a set of tasks in a transaction. If any task fails (raises an
# exception), all tasks executed within the transaction are inspected to
# see if they have an associated on_rollback hook, and if so, that hook
# is called.
Invoke a set of tasks in a transaction. If any task fails (raises an
exception), all tasks executed within the transaction are inspected to
see if they have an associated on_rollback hook, and if so, that hook
is called.
Invoke a set of tasks in a transaction . If any task fails ( raises an exception ) all tasks executed within the transaction are inspected to see if they have an associated on_rollback hook and if so that hook is called .
def transaction
        raise ArgumentError, "expected a block" unless block_given?
        raise ScriptError, "transaction must be called from within a task" if task_call_frames.empty?
        return yield if transaction?
        logger.info "transaction: start"
        begin
          self.rollback_requests = []
          yield
          logger.info "transaction: commit"
        rescue Object => e
          rollback!
          raise
        ensure
          self.rollback_requests = nil if Thread.main == Thread.current
        end
      end
def transaction raise ArgumentError , "expected a block" unless block_given? raise ScriptError , "transaction must be called from within a task" if task_call_frames . empty? return yield if transaction? logger . info "transaction: start" begin self . rollback_requests = [ ] yield logger . info "transaction: commit" rescue Object => e rollback! raise ensure self . rollback_requests = nil if Thread . main == Thread . current end end
Invoke a set of tasks in a transaction.
Invoke a set of tasks in a transaction .