0

This is the code that I have

class ExampleTask
    extend Resque::Plugins::ExponentialBackoff
    @backoff_strategy = [0, 20, 3600]
    @queue = :example_tasks
    def self.perform
      raise
    end
  end

I am running into a problem where, whenever I enqueue this task locally, Resque seems to retry the task immediately without respecting the backoff strategy. Has anyone ever experienced this problem before?

denniss
  • 17,229
  • 26
  • 92
  • 141

2 Answers2

0

upgrading to 1.0.0 actually solves this problem.

denniss
  • 17,229
  • 26
  • 92
  • 141
0

For any future readers, the first integer in the array @backoff_strategy is how long Resque-Retry will wait before retrying the first time. From the github readme:

key: m = minutes, h = hours

              no delay, 1m, 10m,   1h,    3h,    6h
@backoff_strategy = [0, 60, 600, 3600, 10800, 21600]
@retry_delay_multiplicand_min = 1.0
@retry_delay_multiplicand_max = 1.0

The first delay will be 0 seconds, the 2nd will be 60 seconds, etc... Again, tweak to your own needs.
Phil
  • 2,732
  • 19
  • 20