mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-08 11:20:17 -05:00
Fix: Leasing for payload job (#2609)
* refactor: acquire a lease instead of an advisory lock * refactor: partition dates * fix: single query to acquire / extend * fix: explicit alias * fix: unwind * fix: hwere clause * fix: handle no rows * fix: lease bug * fix: rm debug * fix: comment for clarity * fix: syntax that doesn't actually matter * fix: error
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
ALTER TABLE v1_payload_cutover_job_offset
|
||||
ADD COLUMN lease_process_id UUID NOT NULL DEFAULT gen_random_uuid(),
|
||||
ADD COLUMN lease_expires_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
|
||||
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
ALTER TABLE v1_payload_cutover_job_offset
|
||||
DROP COLUMN lease_expires_at,
|
||||
DROP COLUMN lease_process_id;
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user