run executes the poll loop that periodically scans for stuck queued transactions.
(ctx context.Context)
| 101 | |
| 102 | // run executes the poll loop that periodically scans for stuck queued transactions. |
| 103 | func (p *QueuedTransactionRecoveryProcessor) run(ctx context.Context) { |
| 104 | ticker := time.NewTicker(p.pollInterval) |
| 105 | defer ticker.Stop() |
| 106 | |
| 107 | for { |
| 108 | select { |
| 109 | case <-ctx.Done(): |
| 110 | logrus.Info("Queued transaction recovery processor context cancelled") |
| 111 | return |
| 112 | case <-p.stopCh: |
| 113 | logrus.Info("Queued transaction recovery processor stop signal received") |
| 114 | return |
| 115 | case <-ticker.C: |
| 116 | p.processBatch(ctx) |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | // processBatch performs one periodic stuck-queue recovery pass using the configured threshold. |
| 122 | func (p *QueuedTransactionRecoveryProcessor) processBatch(ctx context.Context) { |
no test coverage detected