Stop shuts down the background recovery loop and waits for the worker goroutine to exit.
()
| 79 | |
| 80 | // Stop shuts down the background recovery loop and waits for the worker goroutine to exit. |
| 81 | func (p *QueuedTransactionRecoveryProcessor) Stop() { |
| 82 | p.mu.Lock() |
| 83 | if !p.running { |
| 84 | p.mu.Unlock() |
| 85 | return |
| 86 | } |
| 87 | p.running = false |
| 88 | close(p.stopCh) |
| 89 | p.mu.Unlock() |
| 90 | |
| 91 | p.wg.Wait() |
| 92 | logrus.Info("Queued transaction recovery processor stopped") |
| 93 | } |
| 94 | |
| 95 | // IsRunning reports whether the recovery processor is currently active. |
| 96 | func (p *QueuedTransactionRecoveryProcessor) IsRunning() bool { |
no test coverage detected