← Back to context

Comment by tylergetsay

3 years ago

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

You can do something like UPDATE row SET timeout = NOW() WHERE NOW() - taskTimeout > row.timestamp. You're not stuck with comparing bools.

update tasks set taken_timestamp = now() where task_id = ? and taken_timestamp is null