sidekiq-throttled icon indicating copy to clipboard operation
sidekiq-throttled copied to clipboard

Multiple throttle options

Open apetrov88 opened this issue 2 years ago • 5 comments
trafficstars

Is it possible to set multiple throttle option like:

5 per 1 minute 100 per 1 hour 1000 per 1 day

All of them for the same worker.

apetrov88 avatar Jun 08 '23 13:06 apetrov88

You should be able to do something like:

sidekiq_throttled(
  threshold: [
    { limit: 5, period: 5.minutes, key_suffix: "minutely" },
    { limit: 100, period: 1.hour, key_suffix: "hourly" },
    { limit: 1000, period: 1.day, key_suffix: "daily" },
  ]
)

ixti avatar Jun 08 '23 18:06 ixti

Does not seem to work for me. Can you confirm the settings above are correctly?

apetrov88 avatar Jul 18 '23 07:07 apetrov88

@apetrov88 What's your sidekiq and sidekiq-throttled version?

danishsatkut avatar Nov 20 '23 20:11 danishsatkut