Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tylergetsay
on Sept 24, 2023
|
parent
|
context
|
favorite
| on:
Choose Postgres queue technology
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
jayd16
on Sept 24, 2023
|
next
[–]
You can do something like UPDATE row SET timeout = NOW() WHERE NOW() - taskTimeout > row.timestamp. You're not stuck with comparing bools.
twic
on Sept 24, 2023
|
prev
|
next
[–]
update tasks set taken_timestamp = now() where task_id = ? and taken_timestamp is null
AdamJacobMuller
on Sept 25, 2023
|
prev
[–]
update row set taken=true,taken_by=my_id,taken_at=now() where taken is false;
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: