fix: guard ledger outbox outcomes by lease

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-12 13:29:05 +00:00
committed by GitHub
co-authored by genichin
parent 31d6e5c02b
commit 0b5b4660e5
+1 -2
View File
@@ -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])