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

How to use ttl_lock configuration #83

Open
alfredo-rico opened this issue Sep 26, 2024 · 0 comments
Open

How to use ttl_lock configuration #83

alfredo-rico opened this issue Sep 26, 2024 · 0 comments

Comments

@alfredo-rico
Copy link

Hi 👋 sorry for making this question in the issues but I didn't find any proper documentation somewhere so I decided to ask here.

It's no clear to me how to use ttl_lock. is it the time that the thread would be locked? lets suppose this scenario:
I have a sidekiq job that runs every 10 minutes with sidekiq-scheduler and also I defined it as unique with:

unique :while_executing, ttl_lock: 8.minutes, on_conflict: :log

Usually the job takes two minutes to finish, And lets imagine that at some moment the current job takes more than 10 minutes. Sidekiq start a new job and what will happen? will it start to execute the next job because the lock has been released without waiting for the previous one? how to avoid this situation? should I defined a largest ttl_lock ?

Thank you!

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

1 participant