fix: fence worker retries and object publication
This commit is contained in:
17
migrations/015_worker_attempt_leases.sql
Normal file
17
migrations/015_worker_attempt_leases.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
ALTER TABLE tasks
|
||||
ADD COLUMN IF NOT EXISTS processing_attempt BIGINT NOT NULL DEFAULT 0,
|
||||
ADD COLUMN IF NOT EXISTS lease_owner UUID,
|
||||
ADD COLUMN IF NOT EXISTS lease_until TIMESTAMPTZ;
|
||||
|
||||
ALTER TABLE task_files
|
||||
ADD COLUMN IF NOT EXISTS processing_attempt BIGINT NOT NULL DEFAULT 0,
|
||||
ADD COLUMN IF NOT EXISTS lease_owner UUID,
|
||||
ADD COLUMN IF NOT EXISTS lease_until TIMESTAMPTZ;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_tasks_processing_lease
|
||||
ON tasks(lease_until)
|
||||
WHERE status = 'processing';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_task_files_processing_lease
|
||||
ON task_files(task_id, lease_until)
|
||||
WHERE status = 'processing';
|
||||
Reference in New Issue
Block a user