Created
March 3, 2017 14:52
-
-
Save peterbe/20cef3468192fc08628073cb7070ccb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
SELECT ongoing FROM crontabber WHERE app_name = 'bar' | |
FOR UPDATE NOWAIT; | |
select pg_sleep(random() * 10); | |
UPDATE crontabber SET ongoing = now() WHERE app_name = 'bar'; | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment