about summary refs log tree commit diff
path: root/app/workers/concerns
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/concerns')
-rw-r--r--app/workers/concerns/exponential_backoff.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/concerns/exponential_backoff.rb b/app/workers/concerns/exponential_backoff.rb
new file mode 100644
index 000000000..f2b931e33
--- /dev/null
+++ b/app/workers/concerns/exponential_backoff.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module ExponentialBackoff
+  extend ActiveSupport::Concern
+
+  included do
+    sidekiq_retry_in do |count|
+      15 + 10 * (count**4) + rand(10 * (count**4))
+    end
+  end
+end