MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / runQueuedBatchPostCommitWork

Method runQueuedBatchPostCommitWork

transaction.go:1093–1102  ·  view source on GitHub ↗

runQueuedBatchPostCommitWork dispatches the post-commit work for a coalesced batch after the balance-set lock has been released.

(ctx context.Context, span trace.Span, result queuedBatchPersistResult)

Source from the content-addressed store, hash-verified

1091// runQueuedBatchPostCommitWork dispatches the post-commit work for a coalesced batch after
1092// the balance-set lock has been released.
1093func (l *LedgerForge) runQueuedBatchPostCommitWork(ctx context.Context, span trace.Span, result queuedBatchPersistResult) {
1094 postHooks, err := l.listHooksForExecution(ctx, ledgerforgehooks.PostTransaction)
1095 if err != nil {
1096 logrus.WithError(err).Warn("failed to list post-transaction hooks for coalesced batch; falling back to per-transaction lookup")
1097 l.runTransactionPostCommitWork(ctx, span, result.orderedBalances, result.postCommitWork)
1098 return
1099 }
1100
1101 l.runTransactionPostCommitWorkWithHooks(ctx, span, result.orderedBalances, result.postCommitWork, postHooks)
1102}
1103
1104// runTransactionPostCommitWork executes monitor checks, post-hooks, and post-transaction
1105// actions for already-persisted work items outside the locked persistence path.

Callers 1

Calls 4

listHooksForExecutionMethod · 0.95
WarnMethod · 0.45

Tested by

no test coverage detected