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

allow providing client_id when locking / providing the unique value from outside the library #131

Open
talarari opened this issue May 30, 2023 · 1 comment

Comments

@talarari
Copy link

right now the value of the redlock key is just a secure random id.
when not able to acquire a lock its useful to be able to know who is holding the lock, to troubleshoot bad locks
the way to do this is to append a client_id to the unique id , something like {client_id}_{uuid}

this way when failing to acquire a lock , we can read the key and see who holds the lock

a more general way to do this as a library would be to allow library users to provide a function to generate the unique id in options
this way i could build they key however i like and add the metadata i need

thoughts?

@leandromoreira
Copy link
Owner

Hi @talarari it seems to be reasonable, I guess extending the current library to accept a generator function would be nice.

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