refactor: tidy tbank-sync claim comments (WealthLedger/backend#166)
This commit is contained in:
@@ -3,17 +3,13 @@ import type { TbankSyncAttempt } from './tbank-access.service';
|
||||
|
||||
const NO_UPDATED_ROWS = 0;
|
||||
|
||||
// Shared owners for the tbank-sync DB claim/lock protocol (backend#166).
|
||||
// Shared owners for the tbank-sync DB claim/lock protocol.
|
||||
// Both helpers are CAS fences: they run inside the caller's transaction and
|
||||
// keep the exact where/data shapes they replaced. Callers keep deciding
|
||||
// success from the claim count exactly as before.
|
||||
|
||||
// Claims the active TbankSyncWork row: only the still-running attempt of a
|
||||
// valid connection may transition. `data` is the state transition to apply.
|
||||
// `state` overrides the default 'running' fence (e.g. an initiator row also
|
||||
// accepts 'complete'); `withoutConnectionFence` drops the
|
||||
// `connection: { invalidToken: false }` guard for fences that must also fire
|
||||
// on an invalidated connection.
|
||||
export type ClaimOptions = {
|
||||
// Overrides the default 'running' fence (e.g. an initiator row also
|
||||
// accepts 'complete').
|
||||
|
||||
Reference in New Issue
Block a user