diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:31:45 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:31:45 +0100 |
| commit | a8c1d47132d4c47863ae7dc5b6f4816d024d3de4 (patch) | |
| tree | 505211909c9caa36ceb3cba2050e4d10cb65598d /src/tasks/mod.rs | |
| parent | music: reject live streams on the yt-dlp path (diff) | |
| download | senator-sperma-a8c1d47132d4c47863ae7dc5b6f4816d024d3de4.tar.gz senator-sperma-a8c1d47132d4c47863ae7dc5b6f4816d024d3de4.zip | |
cron: validate expressions and allocate ids atomically
Diffstat (limited to '')
| -rw-r--r-- | src/tasks/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tasks/mod.rs b/src/tasks/mod.rs index c895a1b..5506487 100644 --- a/src/tasks/mod.rs +++ b/src/tasks/mod.rs | |||
| @@ -22,7 +22,7 @@ pub struct CronContext { | |||
| 22 | 22 | ||
| 23 | /// Normalize user-friendly cron expressions to the 7-field format the `cron` crate expects. | 23 | /// Normalize user-friendly cron expressions to the 7-field format the `cron` crate expects. |
| 24 | /// Supports: 5-field (min hour dom month dow) and 6-field (sec min hour dom month dow). | 24 | /// Supports: 5-field (min hour dom month dow) and 6-field (sec min hour dom month dow). |
| 25 | fn parse_cron(raw: &str) -> Result<Schedule, cron::error::Error> { | 25 | pub(crate) fn parse_cron(raw: &str) -> Result<Schedule, cron::error::Error> { |
| 26 | let fields: Vec<&str> = raw.split_whitespace().collect(); | 26 | let fields: Vec<&str> = raw.split_whitespace().collect(); |
| 27 | let normalized = match fields.len() { | 27 | let normalized = match fields.len() { |
| 28 | 7 => raw.to_string(), | 28 | 7 => raw.to_string(), |
