lib/donaghy/middleware/retry.rb
# 15 minute max, so about 50 hours
15 minute max, so about 50 hours
15 minute max so about 50 hours
def call(event, _)
        yield
      rescue Exception => e
        event.retry_count += 1
        if event.retry_count > MAX_RETRY_ATTEMPTS
          logger.error("event #{event.id} failed over #{MAX_RETRY_ATTEMPTS} times")
          event.acknowledge
        elsif event.retry_count > 2 and Donaghy.storage.member_of?('kill_list', event.id)
          logger.error("event #{event.id} was killed due to a kill_list entry")
          event.acknowledge
        else
          Donaghy.storage.inc('retry', 1)
          event.requeue(delay: delay(event))
        end
        raise e
      end
def call ( event , _ ) yield rescue Exception => e event . retry_count += 1 if event . retry_count > MAX_RETRY_ATTEMPTS logger . error ( "event #{event.id} failed over #{MAX_RETRY_ATTEMPTS} times" ) event . acknowledge elsif event . retry_count > 2 and Donaghy . storage . member_of? ( 'kill_list' , event . id ) logger . error ( "event #{event.id} was killed due to a kill_list entry" ) event . acknowledge else Donaghy . storage . inc ( 'retry' , 1 ) event . requeue ( delay : delay ( event ) ) end raise e end
15 minute max, so about 50 hours
15 minute max so about 50 hours
event
<not_specific>
_
<not_specific>