Документация и runtime: полный production-fix по fix6 без legacy

This commit is contained in:
2026-05-10 22:58:59 +05:00
parent 83c4e3ba05
commit 819cc9c308
12 changed files with 106 additions and 267 deletions
+9
View File
@@ -96,6 +96,9 @@ fn persist_plan(planned: NaiveDateTime) {
fn next_reboot_time(start_hhmm: &str, end_hhmm: &str) -> anyhow::Result<NaiveDateTime> {
let start = parse_hhmm(start_hhmm)?;
let end = parse_hhmm(end_hhmm)?;
if start == end {
anyhow::bail!("reboot window start and end must differ");
}
let now = Utc::now().naive_utc();
let now_t = NaiveTime::from_hms_opt(now.hour(), now.minute(), now.second())
@@ -233,5 +236,11 @@ mod tests {
assert_eq!(s, now);
assert_eq!(e.format("%Y-%m-%d %H:%M:%S").to_string(), "2026-01-11 02:00:00");
}
#[test]
fn equal_window_boundaries_rejected() {
let err = next_reboot_time("01:00", "01:00").err();
assert!(err.is_some());
}
}