Sha256: 584b045138c97873f4a0be987484949c5bda44579f012d30c7b579d50be6dbd7

Contents?: true

Size: 737 Bytes

Versions: 15

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module AdvancedSneakersActiveJob
  # Calculating exponential backoff by formulas with randomization leads to numerous RabbitMQ queues.
  EXPONENTIAL_BACKOFF = {
    1 => 3,       # 3 seconds
    2 => 30,      # 30 seconds
    3 => 90,      # 1.5 minutes
    4 => 240,     # 4 minutes
    5 => 600,     # 10 minutes
    6 => 1200,    # 20 minutes
    7 => 2400,    # 40 minutes
    8 => 3600,    # 1 hour
    9 => 7200,    # 2 hours
    10 => 10_800, # 3 hours
    11 => 14_400, # 4 hours
    12 => 21_600, # 6 hours
    13 => 28_800, # 8 hours
    14 => 36_000, # 10 hours
    15 => 50_400, # 14 hours
    16 => 64_800, # 18 hours
    17 => 86_400  # 24 hours
  }.tap { |h| h.default = 86_400 }.freeze
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
advanced-sneakers-activejob-0.6.0 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.5.0 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.4.0 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.6 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.5 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.4 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.3 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.2 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.1 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.3.0 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.2.3 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.2.2 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.2.1 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.2.0 lib/advanced_sneakers_activejob/exponential_backoff.rb
advanced-sneakers-activejob-0.1.0 lib/advanced_sneakers_activejob/exponential_backoff.rb