ixti / sidekiq-throttled

Concurrency and rate-limit throttling for Sidekiq
MIT License
698 stars 75 forks source link

Replace "end" with "head" in test cases #156

Closed yykamei closed 10 months ago

yykamei commented 11 months ago

basic_fetch_spec.rb tests the behavior of requeue of retrieve_work. As far as I see, requeue_throttled uses Redis LPUSH, which inserts all the specified values at the head of the list stored at key.

However, the previous test cases were telling "pushes job back to the end queue". I think this is not correct.

When I was assessing this repository, I was a bit confused by the test case, so I want to correct the test case.

ixti commented 10 months ago

After my (not so successful) attempts to blindly understand the API of Sidekiq-Pro I believe if we are to support it - then we will need to provide different push back strategies. Sidekiq-Pro, from what I can tell, uses RPOPLPUSH for "reliable-client" (or whatever it is called these days). So in that case it will be the opposite. I'm fine with this PR ritgh now though!

yykamei commented 10 months ago

we will need to provide different push back strategies.

I agree with you. It would be awesome to have another option to requeue jobs with another Redis command.

Thank you for merging anyway.