fix: guard ledger outbox outcomes by lease
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
31d6e5c02b
commit
0b5b4660e5
@@ -745,8 +745,7 @@ class PostgreSQLLedgerOutbox:
|
|||||||
]
|
]
|
||||||
where = "WHERE correlation_id=%s AND instance_key=%s "
|
where = "WHERE correlation_id=%s AND instance_key=%s "
|
||||||
if expected_claim_expires_at is None:
|
if expected_claim_expires_at is None:
|
||||||
where += "AND status=%s AND claim_owner IS NULL AND claim_expires_at IS NULL"
|
where += "AND claim_owner IS NULL AND claim_expires_at IS NULL"
|
||||||
params.append(WorkItemStatus.COMPLETED.value)
|
|
||||||
else:
|
else:
|
||||||
where += "AND claim_owner=%s AND claim_expires_at=%s"
|
where += "AND claim_owner=%s AND claim_expires_at=%s"
|
||||||
params.extend([self._worker_id, expected_claim_expires_at])
|
params.extend([self._worker_id, expected_claim_expires_at])
|
||||||
|
|||||||
Reference in New Issue
Block a user