ixti / sidekiq-throttled

Concurrency and rate-limit throttling for Sidekiq
MIT License
713 stars 77 forks source link

Multiple throttle options #149

Open apetrov88 opened 1 year ago

apetrov88 commented 1 year ago

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.

ixti commented 1 year ago

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" },
  ]
)
apetrov88 commented 1 year ago

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

danishsatkut commented 11 months ago

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