-
Notifications
You must be signed in to change notification settings - Fork 48
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
Disable retries #24
Comments
There's a retryDelay property that sets how long to wait before a retry. However, you generally want to keep this low. This property comes into effect when the connection to redis couldn't be established. When there's no connection, this module does nothing. No locks are issued. So, disabling retries wouldn't be useful. |
That makes sense. We are wondering about the case where a function is running on multiple servers and only needs to be run once, we don't care which server runs it, as long as it's only run once. It may be a nice feature to have, if the function is locked rather than trying again, just stop trying. |
This is useful for things like sending out emails. |
You might want to look at https://github.com/errorception/cumin for things like that. It's what I use to send emails (and many other such tasks). |
Thanks for that, I'm not actually using it for sending emails, just an example I was coming up with. We used to use warlock and migrated to redis-lock since warlock isn't under development anymore it appears. We liked the idea of not having retries because we use locks to flip the status of items, and while a queue does work, it's just easier if we can "cancel" retries altogether, maybe by setting a retryDelay of negative it just doesn't retry. This might work since setTimeout will ignore negative numbers. |
Agree on this. I have a fork with this feature: https://github.com/lucaswxp/redis-lock All tests are passing. |
Is there any way to disable retries?
The text was updated successfully, but these errors were encountered: