You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is expected or not, but while trying to work with this gem I found myself needing to customize the order in which middlewares are run. And I need throttled middleware to run after a particular middleware. Now the problem is that the throttled middleware still runs before every other middleware. I did a little bit of investigation and what I found is this, let me know if it makes sense:
In sidekiq when you perform_async the job will later be processed by processor.rb, but that will actually run the middleware after fetching the job, but before processing. And ThrottledFetcher overrides the fetch so that it checks whether the job has to be processed before it is actually processed(which makes sense) but it makes the middleware order useless
The text was updated successfully, but these errors were encountered:
As throttled jobs are not being processed - server middlewares are not executed on those. If you need some middlewares to be still executed on throttled ones, you can add observer proc that is called on each rate limiter breach. If you need "global" observer - I'll be happy to review the PR, otherwise I might add that myself when and if I will have time for that.
Not sure if this is expected or not, but while trying to work with this gem I found myself needing to customize the order in which middlewares are run. And I need
throttled
middleware to run after a particular middleware. Now the problem is that thethrottled
middleware still runs before every other middleware. I did a little bit of investigation and what I found is this, let me know if it makes sense:In sidekiq when you
perform_async
the job will later beprocessed
byprocessor.rb
, but that will actually run the middleware afterfetch
ing the job, but beforeprocess
ing. AndThrottledFetcher
overrides thefetch
so that it checks whether the job has to be processed before it is actually processed(which makes sense) but it makes the middleware order uselessThe text was updated successfully, but these errors were encountered: