feat(catchup): arm on hello, fire missed-window backups on tick

This commit is contained in:
2026-06-15 21:02:04 +01:00
parent 7aaafceab5
commit 5c4e0275d9
4 changed files with 118 additions and 5 deletions
+6
View File
@@ -483,6 +483,12 @@ func (s *Server) onAgentHello(ctx context.Context, hostID string, conn *ws.Conn)
// and the drain may take seconds across many rows. A non-blocking
// goroutine keeps the hello path snappy.
go s.DrainPending(context.Background(), hostID)
// Intermittent hosts that just reconnected may have slept through a
// backup window. Arm a catch-up evaluation after a settle delay; the
// pending-drain tick fires it. Always-on hosts never need this.
if host, err := s.deps.Store.GetHost(ctx, hostID); err == nil && !host.AlwaysOn {
s.ArmCatchup(hostID, time.Now().UTC())
}
}
// maybeAutoInit dispatches a `restic init` job iff the host has no