run is the main processing loop.
(ctx context.Context)
| 143 | |
| 144 | // run is the main processing loop. |
| 145 | func (p *LineageOutboxProcessor) run(ctx context.Context) { |
| 146 | ticker := time.NewTicker(p.pollInterval) |
| 147 | defer ticker.Stop() |
| 148 | |
| 149 | for { |
| 150 | select { |
| 151 | case <-ctx.Done(): |
| 152 | logrus.Info("Lineage outbox processor context cancelled") |
| 153 | return |
| 154 | case <-p.stopCh: |
| 155 | logrus.Info("Lineage outbox processor stop signal received") |
| 156 | return |
| 157 | case <-ticker.C: |
| 158 | p.processBatch(ctx) |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | // processBatch claims and processes a batch of pending outbox entries. |
| 164 | func (p *LineageOutboxProcessor) processBatch(ctx context.Context) { |
no test coverage detected