Files
felhom.eu/hub/internal/osupdates/deliberate_off.go
T
admin 50e47e29af
gates / gates (push) Successful in 6m40s
Hub v0.149.0: a box the household switched off is not an outage for 14 days (R-998)
hosts.deliberate_off_at follows the agent's deliberate_off field (set, then cleared by the first
report of a new boot; one info event each way). While held, every silence alarm is held: host and
node staleness, the 05:00 backup deadlines, off-site and restore-test freshness, the OS alarms and
the kernel notice. After 14 days the usual alarms fire once, naming the power-off. Pages show
KIKAPCSOLVA and the time. Consequence tests with controls; each guard red-proofed.
2026-10-13 19:47:02 +02:00

22 lines
709 B
Go

package osupdates
import (
"time"
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
)
// notDeliberatelyOff drops the hosts the household switched off with „A gép kikapcsolása" (R-998, doc 14) while the
// 14-day hold lasts: a box that is off cannot run its OS leg, take a new agent or bundle, or restart for a kernel —
// alarming about it, or mailing „tonight your box restarts", would be noise. After the hold they count again.
func notDeliberatelyOff(st *store.Store, hosts []store.Host, now time.Time) []store.Host {
out := hosts[:0:0]
for _, h := range hosts {
if store.DeliberateOffHeld(st.HostDeliberateOffAt(h.HostID), now) {
continue
}
out = append(out, h)
}
return out
}