Skip to content

Instantly share code, notes, and snippets.

@peterbe

peterbe/test.sql

Created Mar 3, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.