Sha256: 8a0b9277a56ce426ecf526d353be05b06cc3911bb7e25c120cf884c078865fa4

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 Bytes

Contents

module PhobosDBCheckpoint
  class RetryFailure
    def initialize(failure)
      @failure = failure
    end

    def perform
      result = retry_failure!
      @failure.destroy
      result
    end

    private

    def retry_failure!
      handler
        .consume(
          @failure.payload.to_json,
          @failure.metadata.merge(retry_count: 0)
        )
    end

    def handler
      @failure
        .configured_handler
        .new
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phobos_db_checkpoint-2.0.0 lib/phobos_db_checkpoint/actions/retry_failure.rb