Sha256: 16e94258c5fd4ba966e8694fc9bb7d117bf1e73f9793f7fe5e1837cf9f72c771

Contents?: true

Size: 454 Bytes

Versions: 4

Compression:

Stored size: 454 Bytes

Contents

module CronoTrigger
  class ExecutionTracker
    def initialize(schedulable)
      @schedulable = schedulable
    end

    def track(&pr)
      if @schedulable.track_execution
        begin
          execution = @schedulable.crono_trigger_executions.create_with_timestamp!
          pr.call
          execution.complete!
        rescue => e
          execution.error!(e)
          raise
        end
      else
        pr.call
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
crono_trigger-0.5.4 lib/crono_trigger/execution_tracker.rb
crono_trigger-0.5.3 lib/crono_trigger/execution_tracker.rb
crono_trigger-0.5.2 lib/crono_trigger/execution_tracker.rb
crono_trigger-0.5.0 lib/crono_trigger/execution_tracker.rb