0.1.52 Gateway
This commit is contained in:
@@ -63,6 +63,28 @@ func (h *embyHealth) begin(interval time.Duration, now time.Time) {
|
||||
}
|
||||
}
|
||||
|
||||
// retune follows the operator changing the probe's cadence, or switching it off, without
|
||||
// disturbing what the probe has already found. It is deliberately not `begin`: that
|
||||
// starts a fresh watch and drops the Emby version with it, which the About page reads and
|
||||
// which is still true whatever the interval is now.
|
||||
func (h *embyHealth) retune(interval time.Duration, now time.Time) {
|
||||
h.mu.Lock()
|
||||
defer h.mu.Unlock()
|
||||
if interval <= 0 {
|
||||
h.state.monitored = false
|
||||
h.state.retryEvery = 0
|
||||
return
|
||||
}
|
||||
if !h.state.monitored {
|
||||
h.state = embyHealthState{
|
||||
monitored: true, reachable: true, since: now, retryEvery: interval,
|
||||
version: h.state.version,
|
||||
}
|
||||
return
|
||||
}
|
||||
h.state.retryEvery = interval
|
||||
}
|
||||
|
||||
// record folds one probe result in and reports whether the published verdict changed.
|
||||
func (h *embyHealth) record(ok bool, version string, now time.Time) {
|
||||
h.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user