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

Disable retries #24

Open
BrandonCopley opened this issue Dec 22, 2017 · 6 comments
Open

Disable retries #24

BrandonCopley opened this issue Dec 22, 2017 · 6 comments

Comments

@BrandonCopley
Copy link

Is there any way to disable retries?

@rakeshpai
Copy link
Member

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.

@BrandonCopley
Copy link
Author

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.

@BrandonCopley
Copy link
Author

This is useful for things like sending out emails.

@rakeshpai
Copy link
Member

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).

@BrandonCopley
Copy link
Author

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.

@lucaswxp
Copy link

Agree on this.

I have a fork with this feature: https://github.com/lucaswxp/redis-lock
Also made a pull request: #26

All tests are passing.

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

3 participants