Skip to content

The agent that grows with you

fix(cron): mention bare units in the duration parse error

salch-cred260f007c328f
diff --git a/cron/jobs.py b/cron/jobs.py
index 9c012001b96..a59ee936bdb 100644
--- a/cron/jobs.py
+++ b/cron/jobs.py
@@ -787,7 +787,10 @@ def parse_duration(s: str) -> int:
s = s.strip().lower()
match = re.match(r'^(\d*)\s*(m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days)$', s)
if not match:
- raise ValueError(f"Invalid duration: '{s}'. Use format like '30m', '2h', or '1d'")
+ raise ValueError(
+ f"Invalid duration: '{s}'. Use format like '30m', '2h', '1d', "
+ "or a bare unit like 'hour' (defaults to 1)."
+ )
value = int(match.group(1)) if match.group(1) else 1
unit = match.group(2)[0] # First char: m, h, or d