On 22/09/2021 17.18, Sencer Hamarat wrote:
Say, I have code block lie this:lock_id = "non_unique_lock" with advisory_lock(lock_id, wait=True) as acquired: # things to doWhile one process has the lock, when the secondary process runs the same code block, the secondary process must raise an exception if it can't acquire the lock.
Not that I've ever heard of django-pglocks before, but if I understand the documentation at https://github.com/Xof/django-pglocks#usage correctly, would it simply be a matter of setting wait to False and raising an exception is acquired is False?
Kind regards, Kasper Laudrup -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0d2443e8-ffad-aab7-d99e-97cc2ea86773%40stacktrace.dk.
OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature