address greptile review feedback (greploop iteration 7)

- Reject zero-interval schedule_spec to prevent unbounded firing loop
- Use normalized (tz-aware) expires_at when persisting in CREATE path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Krrish Dholakia 2026-05-01 13:31:55 -07:00
parent ca0eae194c
commit 676ed15e28
2 changed files with 2 additions and 2 deletions

View file

@ -166,7 +166,7 @@ async def create_scheduled_task(
schedule_spec=data.schedule_spec,
schedule_tz=data.schedule_tz,
next_run_at=next_run_at,
expires_at=data.expires_at,
expires_at=expires_at,
fire_once=fire_once,
)
return _row_to_response(row)

View file

@ -22,7 +22,7 @@ from apscheduler.triggers.cron import ( # type: ignore[import-not-found, import
)
_INTERVAL_RE = re.compile(r"^\s*(\d+)\s*([smhd])\s*$", re.IGNORECASE)
_INTERVAL_RE = re.compile(r"^\s*([1-9]\d*)\s*([smhd])\s*$", re.IGNORECASE)
_INTERVAL_UNITS = {
"s": "seconds",
"m": "minutes",