desktop/src-tauri/crates/core/src/schedules.rs
Comment 1, line 1
desktop/src-tauri/crates/core/src/schedules.rs:1
//! Per-source collection scheduling with extraction_schedules and schedule_state (M6).Comment 2, line 2
desktop/src-tauri/crates/core/src/schedules.rs:2
//!Comment 3, line 3
desktop/src-tauri/crates/core/src/schedules.rs:3
//! Rules from scheduling.md:Comment 4, line 4
desktop/src-tauri/crates/core/src/schedules.rs:4
//! - Override the global interval with 15 seconds to 24 hours or a daily/weekly time.Comment 5, line 5
desktop/src-tauri/crates/core/src/schedules.rs:5
//! time_of_day uses HH:MM; ISO weekday 1-7 starts Monday. No arbitrary cron or shell commands.Comment 6, line 6
desktop/src-tauri/crates/core/src/schedules.rs:6
//! - Enabled custom schedules override automatic timing; manual refresh includes all enabled sources.Comment 7, line 7
desktop/src-tauri/crates/core/src/schedules.rs:7
//! - Refresh runs merge to prevent concurrent reads of one source; disabled sources are not auto-read.Comment 8, line 8
desktop/src-tauri/crates/core/src/schedules.rs:8
//! - After sleep/shutdown, collect an overdue source once and advance its next due time after a result.Comment 9, line 9
desktop/src-tauri/crates/core/src/schedules.rs:9
//! - Persist the timezone; choose the first repeated DST instant or the first valid instant after a gap.Comment 10, line 16
desktop/src-tauri/crates/core/src/schedules.rs:16
/// Allowed per-source intervals in seconds.Comment 11, line 20
desktop/src-tauri/crates/core/src/schedules.rs:20
/// Source rule with scope=source and schedule_id=source:<instance_id>.Comment 12, line 24
desktop/src-tauri/crates/core/src/schedules.rs:24
/// Rule kind: interval, daily, or weekly.Comment 13, line 26
desktop/src-tauri/crates/core/src/schedules.rs:26
/// Interval-only value: 15..=86400 seconds.Comment 14, line 28
desktop/src-tauri/crates/core/src/schedules.rs:28
/// Daily/weekly local time in 24-hour HH:MM form.Comment 15, line 30
desktop/src-tauri/crates/core/src/schedules.rs:30
/// Weekly ISO weekday 1..=7, Monday through Sunday.Comment 16, line 32
desktop/src-tauri/crates/core/src/schedules.rs:32
/// IANA timezone; on first save, an empty value is fixed to the current statistics timezone.Comment 17, line 48
desktop/src-tauri/crates/core/src/schedules.rs:48
/// Validate supported rule kinds and numeric ranges, rejecting arbitrary cron.Comment 18, line 81
desktop/src-tauri/crates/core/src/schedules.rs:81
// Reject invalid nonempty IANA timezone names; otherwise next_due_ms could return NoneComment 19, line 82
desktop/src-tauri/crates/core/src/schedules.rs:82
// silently and the schedule would never trigger.Comment 20, line 90
desktop/src-tauri/crates/core/src/schedules.rs:90
/// Compute the next due instant in milliseconds without changing storage.Comment 21, line 91
desktop/src-tauri/crates/core/src/schedules.rs:91
/// Disabled/invalid rules or out-of-range times return None; validation checks nonemptyComment 22, line 92
desktop/src-tauri/crates/core/src/schedules.rs:92
/// timezone names and settings validation checks the fallback used for empty names.Comment 23, line 93
desktop/src-tauri/crates/core/src/schedules.rs:93
/// Repeated daily/weekly DST times choose the first instant; gaps advance to the first valid instant.Comment 24, line 147
desktop/src-tauri/crates/core/src/schedules.rs:147
// If no candidate is found within eight days, return the calculated fallback.Comment 25, line 154
desktop/src-tauri/crates/core/src/schedules.rs:154
/// Preview the next three scheduled instants; overdue work is merged by due_instancesComment 26, line 155
desktop/src-tauri/crates/core/src/schedules.rs:155
/// into one collection rather than replaying every missed occurrence.Comment 27, line 169
desktop/src-tauri/crates/core/src/schedules.rs:169
/// Older rules followed the statistics timezone dynamically; persist their currentComment 28, line 170
desktop/src-tauri/crates/core/src/schedules.rs:170
/// effective timezone before later statistics-setting changes.Comment 29, line 180
desktop/src-tauri/crates/core/src/schedules.rs:180
/// Upsert a source schedule, recompute next_due, and increment config_version.Comment 30, line 187
desktop/src-tauri/crates/core/src/schedules.rs:187
// Persist the initial fallback timezone instead of following later statistics changes.Comment 31, line 240
desktop/src-tauri/crates/core/src/schedules.rs:240
/// Delete a source schedule so it inherits global timing.Comment 32, line 254
desktop/src-tauri/crates/core/src/schedules.rs:254
/// Read a source rule for the settings UI.Comment 33, line 298
desktop/src-tauri/crates/core/src/schedules.rs:298
/// Return due instances where schedule/source are enabled and next_due_at_ms <= now.Comment 34, line 299
desktop/src-tauri/crates/core/src/schedules.rs:299
/// Join source_instances.enabled to omit disabled sources.Comment 35, line 300
desktop/src-tauri/crates/core/src/schedules.rs:300
/// Inner joining also omits schedules without an existing source instance.Comment 36, line 301
desktop/src-tauri/crates/core/src/schedules.rs:301
/// An unvisited source has no run result and does not advance its next due time;Comment 37, line 302
desktop/src-tauri/crates/core/src/schedules.rs:302
/// disabled or missing sources do not produce fabricated failure records.Comment 38, line 319
desktop/src-tauri/crates/core/src/schedules.rs:319
/// Instances with enabled custom schedules, excluded from the global automatic interval.Comment 39, line 333
desktop/src-tauri/crates/core/src/schedules.rs:333
/// After an actual result, recompute next_due from now and store success/failure.Comment 40, line 418
desktop/src-tauri/crates/core/src/schedules.rs:418
// Lord Howe advances 30 minutes; a fixed one-hour adjustment is incorrect.Comment 41, line 520
desktop/src-tauri/crates/core/src/schedules.rs:520
// Daily 09:00 UTC: now=2027-01-15T08:00:00Z selects that day at 09:00.Comment 42, line 540
desktop/src-tauri/crates/core/src/schedules.rs:540
// Friday 2027-01-15 (ISO 5) schedules Monday 09:00 on 2027-01-18.Comment 43, line 593
desktop/src-tauri/crates/core/src/schedules.rs:593
// due_instances joins source_instances.enabled; register the instance first.Comment 44, line 616
desktop/src-tauri/crates/core/src/schedules.rs:616
// Not yet due.Comment 45, line 618
desktop/src-tauri/crates/core/src/schedules.rs:618
// Now due.Comment 46, line 623
desktop/src-tauri/crates/core/src/schedules.rs:623
// Advancing the deadline removes it from due instances but retains its custom rule.Comment 47, line 629
desktop/src-tauri/crates/core/src/schedules.rs:629
// Deleting the rule restores global timing.Comment 48, line 670
desktop/src-tauri/crates/core/src/schedules.rs:670
// Disabled sources are omitted even when overdue.Comment 49, line 679
desktop/src-tauri/crates/core/src/schedules.rs:679
// Reenabled sources retain their schedule.Comment 50, line 691
desktop/src-tauri/crates/core/src/schedules.rs:691
// Disabling the rule itself also removes it from due instances.Comment 51, line 715
desktop/src-tauri/crates/core/src/schedules.rs:715
// A valid IANA timezone name passes validation.