KamoCRM

Harden closed-loan trainer — run lock + per-loan idempotency

Featurekamo-shared-library
Shipped
15 ஜூலை, 2026 அன்று 3:25 AM UTC
Author
Kamo
Commit
e4d3e2c

- ClosedLoanTrainingRun.claim(): atomic conditional UPDATE that takes ownership of a run only when it is not already RUNNING or its heartbeat is stale (previous owner died). Stops two workers — a double-clicked control, run-all overlapping a per-org kick, or a second service replica — from walking the same org's loans at once and duplicating corrections / garbling counters. - **************** a closed loan is ground truth, so once labeled there is nothing to re-learn from re-reading its documents. The trainer skips marked loans, which keeps the repeated passes (that exist to catch newly-closed loans) from duplicating labels and skewing the corpus toward frequently-reprocessed loans.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing