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

Function NewQueuedTransactionRecoveryProcessor

queue_recovery.go:47–58  ·  view source on GitHub ↗

NewQueuedTransactionRecoveryProcessor creates the stuck queued-transaction recovery loop with conservative single-worker defaults to avoid recovery-induced lock storms.

(ledgerforge *LedgerForge)

Source from the content-addressed store, hash-verified

45// NewQueuedTransactionRecoveryProcessor creates the stuck queued-transaction recovery loop
46// with conservative single-worker defaults to avoid recovery-induced lock storms.
47func NewQueuedTransactionRecoveryProcessor(ledgerforge *LedgerForge) *QueuedTransactionRecoveryProcessor {
48 return &QueuedTransactionRecoveryProcessor{
49 ledgerforge: ledgerforge,
50 batchSize: 100,
51 maxWorkers: 1,
52 pollInterval: 30 * time.Second,
53 stuckThreshold: 2 * time.Hour,
54 maxRecoveryAttempts: 3,
55 stopCh: make(chan struct{}),
56 processQueuedTransaction: ledgerforge.processQueuedTransaction,
57 }
58}
59
60// Start begins the background recovery loop for stuck queued transactions.
61func (p *QueuedTransactionRecoveryProcessor) Start(ctx context.Context) {

Calls

no outgoing calls