MCPcopy
hub / github.com/prometheus/prometheus / loop

Method loop

tsdb/wlog/watcher.go:281–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279}
280
281func (w *Watcher) loop() {
282 defer close(w.done)
283
284 // We may encounter failures processing the WAL; we should wait and retry.
285 for !isClosed(w.quit) {
286 w.SetStartTime(time.Now())
287 if err := w.Run(); err != nil {
288 w.logger.Error("error tailing WAL", "err", err)
289 }
290
291 select {
292 case <-w.quit:
293 return
294 case <-time.After(5 * time.Second):
295 }
296 }
297}
298
299// Run the watcher, which will tail the WAL until the quit channel is closed
300// or an error case is hit.

Callers 1

StartMethod · 0.95

Calls 4

SetStartTimeMethod · 0.95
RunMethod · 0.95
isClosedFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected