KamoCRM

Fold and recount the public changelog's commit-log ledger

PerformanceDaemonService
Shipped
September 23, 2026 at 1:41 PM UTC
Author
Kamo
Commit
b8aa5d0

securityservice's create_commit_log_ledger.sql (applied by hand as the owner) adds commit_log_counts / commit_log_count_deltas: a total per (project, commit type) plus an append-only journal that row triggers on commit_logs write, the same total+journal shape as the lead ledgers. Add its fold and recount to the existing LeadLedgerMaintenance rather than a sibling class: commit_logs has nothing to do with leads, but the fold/reconcile shape, the 40001 retry rule and the trigger-presence check are identical, and LeadLedgerFoldJob / LeadLedgerReconcileJob already run at exactly the cadence this needs (every 30 s / nightly at 03:40), so a sibling job would only duplicate the Quartz wiring in QuartzConfig. The three new triggers join JOURNAL_TRIGGERS, so a dropped or disabled one is reported at WARN instead of drifting silently until someone notices a wrong count. Verified against the live database before this: the three triggers fire correctly inside a rolled-back transaction (INSERT +1, a key-changing UPDATE moves -1/+1, a non-key UPDATE fires neither, DELETE -1), and total + journal matches COUNT(*) exactly across all 264 (project, commit type) pairs after the backfill.

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