v0.279.0: after_install (decision 45), known default logins on the page, Part D empty-backup alarm, night chain (R-705), R-706
gates / gates (push) Successful in 27s
gates / gates (push) Successful in 27s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -217,6 +217,17 @@ func LegDeadline(now time.Time, window string, loc *time.Location) time.Time {
|
||||
// RunUpdateLeg runs one night's leg and returns its summary (nil when another leg is running or the leg
|
||||
// is not wired). trigger names the caller for the log ("after-offsite").
|
||||
func (m *Manager) RunUpdateLeg(ctx context.Context, trigger string) *UpdateLegSummary {
|
||||
return m.runUpdateLeg(ctx, trigger, false)
|
||||
}
|
||||
|
||||
// RunUpdateLegNow is the leg for a MANUAL run of the night's chain (R-705, the debug action): the same
|
||||
// leg, but its step deadline is its start + the leg's normal length (backupwindow.UpdateLegLengthMin),
|
||||
// not W+5h of the last window — which, by day, has passed and would make the leg start nothing.
|
||||
func (m *Manager) RunUpdateLegNow(ctx context.Context, trigger string) *UpdateLegSummary {
|
||||
return m.runUpdateLeg(ctx, trigger, true)
|
||||
}
|
||||
|
||||
func (m *Manager) runUpdateLeg(ctx context.Context, trigger string, manual bool) *UpdateLegSummary {
|
||||
if !m.leg.run.TryLock() {
|
||||
m.logger.Printf("[WARN] [update-leg] a leg is already running — this call (%s) does nothing", trigger)
|
||||
return nil
|
||||
@@ -249,6 +260,9 @@ func (m *Manager) RunUpdateLeg(ctx context.Context, trigger string) *UpdateLegSu
|
||||
window = o.WindowStart()
|
||||
}
|
||||
sum.Deadline = LegDeadline(sum.StartedAt, window, o.Location)
|
||||
if manual {
|
||||
sum.Deadline = sum.StartedAt.Add(time.Duration(backupwindow.UpdateLegLengthMin) * time.Minute)
|
||||
}
|
||||
m.setLegFlags(true, false)
|
||||
defer m.setLegFlags(false, false)
|
||||
m.logger.Printf("[INFO] [update-leg] started (%s): window %s, no step starts at or after %s", trigger, window, sum.Deadline.In(o.Location).Format("15:04"))
|
||||
|
||||
Reference in New Issue
Block a user