Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just some clarification on the documentation. #530

Closed
richkettle opened this issue Jul 7, 2020 · 3 comments
Closed

Just some clarification on the documentation. #530

richkettle opened this issue Jul 7, 2020 · 3 comments

Comments

@richkettle
Copy link

Hi,

Thanks for the gem guys its been a life saver!

Im currently upgrading from version 3.X to version version 6.X and i just wanted to clarify a few things.

sidekiq_options queue: :critical, retry: 3, unique: true on version 3.

Is synonymous with:
sidekiq_options queue: :critical, retry: 3, lock: :while_executing on version 6.

Reading through the upgrade notes I have come across this:

Due to discoverability of the different lock types unique sidekiq option it was decided to use the while_executing as a default. Most people will note that scheduling any number of jobs with the same arguments is possible.

Emphasis my own.
Which I think is the behaviour I'm seeing:

V3:

MyJob.perform_in(2.seconds, "param_1", "param_2")
MyJob.perform_in(2.seconds, "param_1", "param_2")

MyJob.jobs.size => 1

V6:

MyJob.perform_in(2.seconds, "param_1", "param_2")
MyJob.perform_in(2.seconds, "param_1", "param_2")

MyJob.job.size => 2

From what the upgrade notes state, it appears as though the job can be queued but the queue would be made unique(uniquified) at run time, rather than when the job is created. Which makes the above behaviour correct?

Is there any way to just make it not enqueue the job? To exactly recreate the behaviour of the previous version.

I appreciate that these changes were made quite a while but any help is much appreciated.

@mhenrixon
Copy link
Owner

Hi 🙋‍♂️ @richkettle,

I will try and find some time to rewrite the documentation in the next week.

I have big plans but also two small girls and a wife that not only requires my attention but also that the work I do in front of a computer is paid so that we have food and shelter.

This is just a hobby and unfortunately always ends up being the last thing I have time for.

You are right in that the documentation needs improvement and it was on my todo list for a really long time.

@richkettle
Copy link
Author

Hi 🙋‍♂️ @richkettle,

I will try and find some time to rewrite the documentation in the next week.

I have big plans but also two small girls and a wife that not only requires my attention but also that the work I do in front of a computer is paid so that we have food and shelter.

This is just a hobby and unfortunately always ends up being the last thing I have time for.

You are right in that the documentation needs improvement and it was on my todo list for a really long time.

Hi @mhenrixon

No problem at all. I wasn't implying that the documentation needed work or that it was poor. I just wanted a little clarification on a few bits. Its not normal that someone upgrades from a version this old.

Any help on the questions would be great.

Thanks,

Rich

@mhenrixon
Copy link
Owner

If you can, upgrade to v7.0.1.

The while_executing lock will allow any number of locks in a rails app. We don't enforce uniqueness since it becomes almost impossible to test (some people don't even use real redis). If you despite recommendations are interested in testing the uniquness I have a section in the README about it.

Let me know if there are any follow up questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants