orionis 0.521.0__py3-none-any.whl → 0.523.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -110,21 +110,23 @@ class ScheduleWorkCommand(BaseCommand):
110
110
  if hasattr(scheduler, "onError") and callable(scheduler.onError):
111
111
  schedule_service.setListener(ListeningEvent.SCHEDULER_ERROR, scheduler.onError)
112
112
 
113
- # Check if the scheduler has specific pause, resume, and finalize times
114
- if hasattr(scheduler, "PAUSE_AT") and scheduler.PAUSE_AT is not None:
115
- if not isinstance(scheduler.PAUSE_AT, datetime):
116
- raise CLIOrionisRuntimeError("PAUSE_AT must be a datetime instance.")
117
- schedule_service.pauseEverythingAt(scheduler.PAUSE_AT)
113
+ # If the scheduler has FINALIZE_AT and it is not None
114
+ if hasattr(scheduler, "FINALIZE_AT") and scheduler.FINALIZE_AT is not None:
115
+ if not isinstance(scheduler.FINALIZE_AT, datetime):
116
+ raise CLIOrionisRuntimeError("FINALIZE_AT must be a datetime instance.")
117
+ schedule_service.shutdownEverythingAt(scheduler.FINALIZE_AT)
118
118
 
119
+ # If the scheduler has RESUME_AT and it is not None
119
120
  if hasattr(scheduler, "RESUME_AT") and scheduler.RESUME_AT is not None:
120
121
  if not isinstance(scheduler.RESUME_AT, datetime):
121
122
  raise CLIOrionisRuntimeError("RESUME_AT must be a datetime instance.")
122
123
  schedule_service.resumeEverythingAt(scheduler.RESUME_AT)
123
124
 
124
- if hasattr(scheduler, "FINALIZE_AT") and scheduler.FINALIZE_AT is not None:
125
- if not isinstance(scheduler.FINALIZE_AT, datetime):
126
- raise CLIOrionisRuntimeError("FINALIZE_AT must be a datetime instance.")
127
- schedule_service.shutdownEverythingAt(scheduler.FINALIZE_AT)
125
+ # If the scheduler has PAUSE_AT and it is not None
126
+ if hasattr(scheduler, "PAUSE_AT") and scheduler.PAUSE_AT is not None:
127
+ if not isinstance(scheduler.PAUSE_AT, datetime):
128
+ raise CLIOrionisRuntimeError("PAUSE_AT must be a datetime instance.")
129
+ schedule_service.pauseEverythingAt(scheduler.PAUSE_AT)
128
130
 
129
131
  # Start the scheduler worker asynchronously
130
132
  await schedule_service.start()
@@ -137,4 +139,4 @@ class ScheduleWorkCommand(BaseCommand):
137
139
  # Raise any unexpected exceptions as CLIOrionisRuntimeError
138
140
  raise CLIOrionisRuntimeError(
139
141
  f"An unexpected error occurred while starting the scheduler worker: {e}"
140
- )
142
+ )