You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dbos/_client.py
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
TypeVar,
17
17
Union,
18
18
)
19
+
fromzoneinfoimportZoneInfo
19
20
20
21
importsqlalchemyassa
21
22
@@ -715,6 +716,8 @@ def create_schedule(
715
716
schedule: str,
716
717
context: Any=None,
717
718
workflow_class_name: Optional[str] =None,
719
+
automatic_backfill: bool=False,
720
+
cron_timezone: Optional[str] =None,
718
721
) ->None:
719
722
"""
720
723
Create a cron schedule that periodically invokes a workflow.
@@ -725,12 +728,19 @@ def create_schedule(
725
728
schedule: A cron expression (supports seconds with 6 fields).
726
729
context: A context object passed as the second argument to every invocation. Defaults to ``None``.
727
730
workflow_class_name: Class name for static class method workflows. Defaults to ``None``.
731
+
automatic_backfill: If ``True``, on startup the scheduler will automatically backfill missed executions since the last time the schedule fired. Defaults to ``False``.
732
+
cron_timezone: IANA timezone name (e.g. ``"America/New_York"``) in which to evaluate the cron expression. Defaults to ``None`` (UTC).
728
733
729
734
Raises:
730
735
DBOSException: If the cron expression is invalid or a schedule with the same name already exists.
Create a cron schedule that periodically invokes a workflow function.
@@ -2050,6 +2055,8 @@ def create_schedule(
2050
2055
workflow_fn: The workflow function to invoke. Must accept ``(datetime, context)``.
2051
2056
schedule: A cron expression (supports seconds with 6 fields).
2052
2057
context: A context object passed as the second argument to every invocation. Defaults to ``None``.
2058
+
automatic_backfill: If ``True``, on startup the scheduler will automatically backfill missed executions since the last time the schedule fired. Defaults to ``False``.
2059
+
cron_timezone: IANA timezone name (e.g. ``"America/New_York"``) in which to evaluate the cron expression. Defaults to ``None`` (UTC).
2053
2060
2054
2061
Raises:
2055
2062
DBOSException: If the cron expression is invalid, the workflow is not registered, or a schedule with the same name already exists
0 commit comments