Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sleep before retrying.

  • Loading branch information...
commit a32fdd5c4dabb64caeb6595272365737a094500e 1 parent fda8012
@jonhyman jonhyman authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/sidekiq/processor.rb
View
3  lib/sidekiq/processor.rb
@@ -151,10 +151,11 @@ def retry_and_suppress_exceptions(max_retries = 2)
retry_count = 0
begin
yield
- rescue StandardError
+ rescue => e
retry_count += 1
if retry_count <= max_retries
Sidekiq.logger.debug {"Suppressing and retrying error: #{e.inspect}"}
+ sleep(1)
retry
else
Sidekiq.logger.info {"Exhausted #{max_retries} retries due to Redis timeouts: #{e.inspect}"}
Please sign in to comment.
Something went wrong with that request. Please try again.