Release v0.1.9: enforce Photos API boundary and finalize Server migration
This commit is contained in:
@@ -23,6 +23,10 @@ from pigway_frame_flow.storage.database import encode, now_iso
|
||||
|
||||
def next_run(schedule, after=None):
|
||||
after = after or datetime.now(UTC)
|
||||
if schedule.type == "interval":
|
||||
if schedule.interval_minutes is None:
|
||||
raise FlowError(E.INVALID_REQUEST, "Interval requires interval_minutes")
|
||||
return (after + timedelta(minutes=schedule.interval_minutes)).isoformat()
|
||||
if schedule.type in ("date", "temporary"):
|
||||
if not schedule.at or schedule.at.tzinfo is None:
|
||||
raise FlowError(E.INVALID_REQUEST, "One-time date must include timezone")
|
||||
|
||||
Reference in New Issue
Block a user