Closed jlledom closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.95%. Comparing base (
1b71da2
) to head (5dd5b5e
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thank you!
When using the
concurrency
strategy with dynamic suffix, I'm getting this error fromsidekiq-throttle
:ArgumentError: wrong number of arguments (given 1, expected 2+)
This happens because the
key_suffix
I'm using is not receiving the proper arguments. Consider this dummy job:This follows the documentation, which states that
key_suffix
must accept the same parameters as the job. However,sidekiq-throttle
fails to unwrap theActiveJob
arguments and instead it just calls the:throttled?
and:finalize!
methods passing them the arguments inmsg["args"]
, which inActiveJob
is an array of JSON objects, like this:Some other methods in the
Concurrency
class like:count
or:reset!
also call the:key
method, so they are vulnerable to this error too. However, I haven't found any place in the code where these methods are called with any parameter.I wrote a very simple workaround that seems to work fine for my use case, and the test suite passes.