zlacker

[return to "Launch HN: Hatchet (YC W24) – Open-source task queue, now with a cloud version"]
1. michae+i7[view] [source] 2024-06-27 15:13:24
>>abelan+(OP)
can you run the whole task as a postgres transaction? like if i want to make an idempotent job by only updating some status to "complete" once the job finishes.
◧◩
2. teaear+d9[view] [source] 2024-06-27 15:25:08
>>michae+i7
Not a Hatchet user, but this doesn’t sound like a Hatchet-specific question. Long running transactions could be problematic depending on the details. I handle idempotency by not holding a transaction and instead only upserting records in jobs and using the job record itself to get the status. For example, if you want to know if a PDF has had all of its pages OCR’d, look at all of the job records for the PDF and aggregate them by status. If they’re all complete you’re good to go.
[go to top]