backfill: re-dispatch if 15 minutes have elapsed

If 15 minutes have passed since the backfill request was dispatched and
backfill hasn't completed, then re-dispatch.
This commit is contained in:
Sumner Evans 2022-05-16 20:20:26 -06:00
parent 2ae3d7f5ae
commit feb9f71cb5
No known key found for this signature in database
GPG key ID: 8904527AB50022FD

View file

@ -82,7 +82,13 @@ const (
FROM backfill_queue
WHERE user_mxid=$1
AND type IN (%s)
AND dispatch_time IS NULL
AND (
dispatch_time IS NULL
OR (
dispatch_time < current_timestamp - interval '15 minutes'
AND completed_at IS NULL
)
)
ORDER BY type, priority, queue_id
LIMIT 1
`