News for hackers. Stuff that matters.
Re:Choose Postgres Queue Technology by tylergetsay on Sunday September 24, 2023 @05:02PM (#37637168)
it wont work with a timestamp because each write will have an affected row of 1 beacuse the writes happen at different times. setting a boolean is static
Re:Choose Postgres Queue Technology by jayd16 on Sunday September 24, 2023 @05:15PM (#37637263)
You can do something like UPDATE row SET timeout = NOW() WHERE NOW() - taskTimeout > row.timestamp. You're not stuck with comparing bools.
Re:Choose Postgres Queue Technology by twic on Sunday September 24, 2023 @05:54PM (#37637559)
update tasks set taken_timestamp = now() where task_id = ? and taken_timestamp is null
Re:Choose Postgres Queue Technology by AdamJacobMuller on Sunday September 24, 2023 @08:01PM (#37638322)
update row set taken=true,taken_by=my_id,taken_at=now() where taken is false;