zlacker

[parent] [thread] 3 comments
1. tylerg+(OP)[view] [source] 2023-09-24 21:02:35
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
replies(3): >>jayd16+x1 >>twic+j6 >>AdamJa+Ci
2. jayd16+x1[view] [source] 2023-09-24 21:15:05
>>tylerg+(OP)
You can do something like UPDATE row SET timeout = NOW() WHERE NOW() - taskTimeout > row.timestamp. You're not stuck with comparing bools.
3. twic+j6[view] [source] 2023-09-24 21:54:36
>>tylerg+(OP)
update tasks set taken_timestamp = now() where task_id = ? and taken_timestamp is null
4. AdamJa+Ci[view] [source] 2023-09-25 00:01:48
>>tylerg+(OP)
update row set taken=true,taken_by=my_id,taken_at=now() where taken is false;
[go to top]