Start begins the background recovery loop for stuck queued transactions.
(ctx context.Context)
| 59 | |
| 60 | // Start begins the background recovery loop for stuck queued transactions. |
| 61 | func (p *QueuedTransactionRecoveryProcessor) Start(ctx context.Context) { |
| 62 | p.mu.Lock() |
| 63 | if p.running { |
| 64 | p.mu.Unlock() |
| 65 | return |
| 66 | } |
| 67 | p.running = true |
| 68 | p.stopCh = make(chan struct{}) |
| 69 | p.mu.Unlock() |
| 70 | |
| 71 | p.wg.Add(1) |
| 72 | go func() { |
| 73 | defer p.wg.Done() |
| 74 | p.run(ctx) |
| 75 | }() |
| 76 | |
| 77 | logrus.Info("Queued transaction recovery processor started") |
| 78 | } |
| 79 | |
| 80 | // Stop shuts down the background recovery loop and waits for the worker goroutine to exit. |
| 81 | func (p *QueuedTransactionRecoveryProcessor) Stop() { |
no test coverage detected