()
| 77 | } |
| 78 | |
| 79 | func (w *Watchdog) publishLoop() { |
| 80 | defer w.wg.Done() |
| 81 | tkr := w.clock.TickerFunc(w.ctx, periodHeartbeat, func() error { |
| 82 | err := w.ps.Publish(EventPubsubWatchdog, []byte{}) |
| 83 | if err != nil { |
| 84 | w.logger.Warn(w.ctx, "failed to publish heartbeat on pubsub watchdog", slog.Error(err)) |
| 85 | } else { |
| 86 | w.logger.Debug(w.ctx, "published heartbeat on pubsub watchdog") |
| 87 | } |
| 88 | return err |
| 89 | }, "publish") |
| 90 | // ignore the error, since we log before returning the error |
| 91 | _ = tkr.Wait() |
| 92 | } |
| 93 | |
| 94 | func (w *Watchdog) subscribeMonitor() { |
| 95 | defer w.wg.Done() |
no test coverage detected