orionis 0.621.0__py3-none-any.whl → 0.622.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.
@@ -2768,7 +2768,7 @@ class IEvent(ABC):
2768
2768
  @abstractmethod
2769
2769
  def everyMondayAt(
2770
2770
  self,
2771
- hour: int = 0,
2771
+ hour: int,
2772
2772
  minute: int = 0,
2773
2773
  second: int = 0
2774
2774
  ) -> bool:
@@ -2783,7 +2783,7 @@ class IEvent(ABC):
2783
2783
  Parameters
2784
2784
  ----------
2785
2785
  hour : int, optional
2786
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
2786
+ The hour of the day when the event should run. Must be in the range [0, 23].
2787
2787
  minute : int, optional
2788
2788
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
2789
2789
  second : int, optional
@@ -2811,7 +2811,7 @@ class IEvent(ABC):
2811
2811
  @abstractmethod
2812
2812
  def everyTuesdayAt(
2813
2813
  self,
2814
- hour: int = 0,
2814
+ hour: int,
2815
2815
  minute: int = 0,
2816
2816
  second: int = 0
2817
2817
  ) -> bool:
@@ -2826,7 +2826,7 @@ class IEvent(ABC):
2826
2826
  Parameters
2827
2827
  ----------
2828
2828
  hour : int, optional
2829
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
2829
+ The hour of the day when the event should run. Must be in the range [0, 23].
2830
2830
  minute : int, optional
2831
2831
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
2832
2832
  second : int, optional
@@ -2854,7 +2854,7 @@ class IEvent(ABC):
2854
2854
  @abstractmethod
2855
2855
  def everyWednesdayAt(
2856
2856
  self,
2857
- hour: int = 0,
2857
+ hour: int,
2858
2858
  minute: int = 0,
2859
2859
  second: int = 0
2860
2860
  ) -> bool:
@@ -2869,7 +2869,7 @@ class IEvent(ABC):
2869
2869
  Parameters
2870
2870
  ----------
2871
2871
  hour : int, optional
2872
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
2872
+ The hour of the day when the event should run. Must be in the range [0, 23].
2873
2873
  minute : int, optional
2874
2874
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
2875
2875
  second : int, optional
@@ -2897,7 +2897,7 @@ class IEvent(ABC):
2897
2897
  @abstractmethod
2898
2898
  def everyThursdayAt(
2899
2899
  self,
2900
- hour: int = 0,
2900
+ hour: int,
2901
2901
  minute: int = 0,
2902
2902
  second: int = 0
2903
2903
  ) -> bool:
@@ -2912,7 +2912,7 @@ class IEvent(ABC):
2912
2912
  Parameters
2913
2913
  ----------
2914
2914
  hour : int, optional
2915
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
2915
+ The hour of the day when the event should run. Must be in the range [0, 23].
2916
2916
  minute : int, optional
2917
2917
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
2918
2918
  second : int, optional
@@ -2940,7 +2940,7 @@ class IEvent(ABC):
2940
2940
  @abstractmethod
2941
2941
  def everyFridayAt(
2942
2942
  self,
2943
- hour: int = 0,
2943
+ hour: int,
2944
2944
  minute: int = 0,
2945
2945
  second: int = 0
2946
2946
  ) -> bool:
@@ -2955,7 +2955,7 @@ class IEvent(ABC):
2955
2955
  Parameters
2956
2956
  ----------
2957
2957
  hour : int, optional
2958
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
2958
+ The hour of the day when the event should run. Must be in the range [0, 23].
2959
2959
  minute : int, optional
2960
2960
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
2961
2961
  second : int, optional
@@ -2983,7 +2983,7 @@ class IEvent(ABC):
2983
2983
  @abstractmethod
2984
2984
  def everySaturdayAt(
2985
2985
  self,
2986
- hour: int = 0,
2986
+ hour: int,
2987
2987
  minute: int = 0,
2988
2988
  second: int = 0
2989
2989
  ) -> bool:
@@ -2997,8 +2997,8 @@ class IEvent(ABC):
2997
2997
 
2998
2998
  Parameters
2999
2999
  ----------
3000
- hour : int, optional
3001
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3000
+ hour : int
3001
+ The hour of the day when the event should run. Must be in the range [0, 23].
3002
3002
  minute : int, optional
3003
3003
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3004
3004
  second : int, optional
@@ -3026,7 +3026,7 @@ class IEvent(ABC):
3026
3026
  @abstractmethod
3027
3027
  def everySundayAt(
3028
3028
  self,
3029
- hour: int = 0,
3029
+ hour: int,
3030
3030
  minute: int = 0,
3031
3031
  second: int = 0
3032
3032
  ) -> bool:
@@ -3041,7 +3041,7 @@ class IEvent(ABC):
3041
3041
  Parameters
3042
3042
  ----------
3043
3043
  hour : int, optional
3044
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3044
+ The hour of the day when the event should run. Must be in the range [0, 23].
3045
3045
  minute : int, optional
3046
3046
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3047
3047
  second : int, optional
@@ -311,6 +311,23 @@ class ISchedule(ABC):
311
311
  """
312
312
  pass
313
313
 
314
+ @abstractmethod
315
+ def isPaused(self) -> bool:
316
+ """
317
+ Check if the scheduler is currently paused.
318
+
319
+ This method determines whether the scheduler is in a paused state by checking if there are
320
+ any jobs that were paused using the `pause` method. If there are jobs in the internal set
321
+ `__pausedByPauseEverything`, it indicates that the scheduler has been paused.
322
+
323
+ Returns
324
+ -------
325
+ bool
326
+ True if the scheduler is currently paused (i.e., there are jobs in the paused set);
327
+ False otherwise.
328
+ """
329
+ pass
330
+
314
331
  @abstractmethod
315
332
  def forceStop(self) -> None:
316
333
  """
@@ -57,7 +57,7 @@ class Event(IEvent):
57
57
  self.__purpose: Optional[str] = purpose
58
58
 
59
59
  # Initialize the random delay attribute (in seconds) as None
60
- self.__random_delay: Optional[int] = None
60
+ self.__random_delay: Optional[int] = 0
61
61
 
62
62
  # Initialize the start date for the event as None
63
63
  self.__start_date: Optional[datetime] = None
@@ -74,8 +74,8 @@ class Event(IEvent):
74
74
  # Initialize the listener attribute as None; can be set to an IScheduleEventListener instance
75
75
  self.__listener: Optional[IScheduleEventListener] = None
76
76
 
77
- # Initialize the maximum instances attribute as None
78
- self.__max_instances: Optional[int] = None
77
+ # Initialize the maximum instances attribute as 1
78
+ self.__max_instances: Optional[int] = 1
79
79
 
80
80
  # Initialize the misfire grace time attribute as None
81
81
  self.__misfire_grace_time: Optional[int] = None
@@ -136,7 +136,7 @@ class Event(IEvent):
136
136
  raise CLIOrionisValueError("Max instances must be a positive integer or None.")
137
137
 
138
138
  # Validate that misfire_grace_time is a positive integer if it is set
139
- if self.__misfire_grace_time is not None and (not isinstance(self.__misfire_grace_time, int) or self.__misfire_grace_time <= 0):
139
+ if self.__misfire_grace_time is not None and (not isinstance(self.__misfire_grace_time, int) or self.__misfire_grace_time < 0):
140
140
  raise CLIOrionisValueError("Misfire grace time must be a positive integer or None.")
141
141
 
142
142
  # Construct and return an EventEntity with the current event's attributes
@@ -182,7 +182,7 @@ class Event(IEvent):
182
182
  """
183
183
 
184
184
  # Validate that the seconds parameter is a positive integer
185
- if not isinstance(seconds, int) or seconds <= 0:
185
+ if not isinstance(seconds, int) or seconds < 0:
186
186
  raise CLIOrionisValueError("Misfire grace time must be a positive integer.")
187
187
 
188
188
  # Set the internal misfire grace time attribute
@@ -225,7 +225,7 @@ class Event(IEvent):
225
225
  raise CLIOrionisValueError("The purpose must be a non-empty string.")
226
226
 
227
227
  # Set the internal purpose attribute
228
- self.__purpose = purpose
228
+ self.__purpose = purpose.strip()
229
229
 
230
230
  # Return self to support method chaining
231
231
  return self
@@ -315,11 +315,11 @@ class Event(IEvent):
315
315
  """
316
316
 
317
317
  # Validate that max_seconds is a positive integer
318
- if not isinstance(max_seconds, int) or max_seconds <= 0 or max_seconds > 120:
319
- raise CLIOrionisValueError("Max seconds must be a positive integer between 1 and 120.")
318
+ if not isinstance(max_seconds, int) or max_seconds < 0 or max_seconds > 120:
319
+ raise CLIOrionisValueError("Max seconds must be a positive integer between 0 and 120.")
320
320
 
321
- # Generate a random delay between 1 and max_seconds (inclusive)
322
- self.__random_delay = random.randint(1, max_seconds)
321
+ # Generate a random delay between 0 and max_seconds
322
+ self.__random_delay = random.randint(1, max_seconds) if max_seconds > 0 else 0
323
323
 
324
324
  # Return self to support method chaining
325
325
  return self
@@ -2717,17 +2717,18 @@ class Event(IEvent):
2717
2717
  the trigger.
2718
2718
  """
2719
2719
 
2720
- # Configure the trigger to execute the event every day.
2721
- # Apply any configured start_date, end_date, and random_delay (jitter).
2722
- self.__trigger = IntervalTrigger(
2723
- days=1,
2720
+ # Configure the trigger to execute the event every day at 00:00:00.
2721
+ self.__trigger = CronTrigger(
2722
+ hour=0,
2723
+ minute=0,
2724
+ second=0,
2724
2725
  start_date=self.__start_date, # Restrict the schedule start if set
2725
2726
  end_date=self.__end_date, # Restrict the schedule end if set
2726
2727
  jitter=self.__random_delay # Apply random delay if configured
2727
2728
  )
2728
2729
 
2729
2730
  # Store a human-readable description of the schedule.
2730
- self.__details = "Every day"
2731
+ self.__details = "Every day at 00:00:00"
2731
2732
 
2732
2733
  # Indicate that the scheduling was successful.
2733
2734
  return True
@@ -2788,15 +2789,14 @@ class Event(IEvent):
2788
2789
  if not (0 <= second < 60):
2789
2790
  raise CLIOrionisValueError("Second must be between 0 and 59.")
2790
2791
 
2791
- # Set up the trigger to execute the event daily at the specified time.
2792
- # The IntervalTrigger will fire every day at the given hour, minute, and second.
2793
- self.__trigger = IntervalTrigger(
2794
- days=1,
2792
+ # Set up the trigger to execute the event daily at the specified time using CronTrigger.
2793
+ self.__trigger = CronTrigger(
2795
2794
  hour=hour,
2796
2795
  minute=minute,
2797
2796
  second=second,
2798
2797
  start_date=self.__start_date,
2799
- end_date=self.__end_date
2798
+ end_date=self.__end_date,
2799
+ jitter=self.__random_delay
2800
2800
  )
2801
2801
 
2802
2802
  # Store a human-readable description of the schedule.
@@ -2867,16 +2867,17 @@ class Event(IEvent):
2867
2867
  second: int = 0
2868
2868
  ) -> bool:
2869
2869
  """
2870
- Schedule the event to run every day at a specific hour, minute, and second.
2870
+ Schedule the event to run every N days at a specific hour, minute, and second.
2871
2871
 
2872
- This method configures the event to execute once per day at the specified
2873
- hour, minute, and second. The schedule can be further restricted by previously
2874
- set `start_date` and `end_date` attributes. If a random delay (jitter) has been
2875
- configured, it will be applied to the trigger to help distribute load or avoid
2876
- collisions.
2872
+ This method configures the event to execute every `days` days at the specified
2873
+ hour, minute, and second using a CronTrigger. The schedule can be further restricted
2874
+ by previously set `start_date` and `end_date` attributes. If a random delay (jitter)
2875
+ has been configured, it will be applied to the trigger.
2877
2876
 
2878
2877
  Parameters
2879
2878
  ----------
2879
+ days : int
2880
+ The interval, in days, at which the event should be executed. Must be a positive integer.
2880
2881
  hour : int
2881
2882
  The hour of the day when the event should run. Must be in the range [0, 23].
2882
2883
  minute : int, optional
@@ -2889,23 +2890,22 @@ class Event(IEvent):
2889
2890
  bool
2890
2891
  Returns True if the scheduling was successfully configured. If the input
2891
2892
  is invalid, a `CLIOrionisValueError` is raised and the trigger is not set.
2892
- On success, returns True.
2893
2893
 
2894
2894
  Raises
2895
2895
  ------
2896
2896
  CLIOrionisValueError
2897
- If `hour`, `minute`, or `second` are not integers within the valid ranges.
2897
+ If `days`, `hour`, `minute`, or `second` are not integers within the valid ranges.
2898
2898
 
2899
2899
  Notes
2900
2900
  -----
2901
- The event will be triggered once per day at the specified time, within the optional
2901
+ The event will be triggered every `days` days at the specified time, within the optional
2902
2902
  scheduling window defined by `start_date` and `end_date`. If a random delay (jitter)
2903
2903
  is set, it will be applied to the trigger.
2904
2904
  """
2905
2905
 
2906
2906
  # Validate that the days parameter is a positive integer.
2907
2907
  if not isinstance(days, int) or days <= 0:
2908
- raise CLIOrionisValueError("The interval must be a positive integer.")
2908
+ raise CLIOrionisValueError("Days must be a positive integer.")
2909
2909
 
2910
2910
  # Validate that hour, minute, and second are integers.
2911
2911
  if not isinstance(hour, int) or not isinstance(minute, int) or not isinstance(second, int):
@@ -2921,19 +2921,19 @@ class Event(IEvent):
2921
2921
  if not (0 <= second < 60):
2922
2922
  raise CLIOrionisValueError("Second must be between 0 and 59.")
2923
2923
 
2924
- # Set up the trigger to execute the event daily at the specified time.
2925
- # The IntervalTrigger will fire every day at the given hour, minute, and second.
2926
- self.__trigger = IntervalTrigger(
2927
- days=1,
2924
+ # Set up the trigger to execute the event every N days at the specified time using CronTrigger.
2925
+ self.__trigger = CronTrigger(
2926
+ day=f"*/{days}",
2928
2927
  hour=hour,
2929
2928
  minute=minute,
2930
2929
  second=second,
2931
2930
  start_date=self.__start_date,
2932
- end_date=self.__end_date
2931
+ end_date=self.__end_date,
2932
+ jitter=self.__random_delay
2933
2933
  )
2934
2934
 
2935
2935
  # Store a human-readable description of the schedule.
2936
- self.__details = f"Every day at {hour:02d}:{minute:02d}:{second:02d}"
2936
+ self.__details = f"Every {days} days at {hour:02d}:{minute:02d}:{second:02d}"
2937
2937
 
2938
2938
  # Indicate that the scheduling was successful.
2939
2939
  return True
@@ -3352,7 +3352,7 @@ class Event(IEvent):
3352
3352
 
3353
3353
  def everyMondayAt(
3354
3354
  self,
3355
- hour: int = 0,
3355
+ hour: int,
3356
3356
  minute: int = 0,
3357
3357
  second: int = 0
3358
3358
  ) -> bool:
@@ -3367,7 +3367,7 @@ class Event(IEvent):
3367
3367
  Parameters
3368
3368
  ----------
3369
3369
  hour : int, optional
3370
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3370
+ The hour of the day when the event should run. Must be in the range [0, 23].
3371
3371
  minute : int, optional
3372
3372
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3373
3373
  second : int, optional
@@ -3406,13 +3406,13 @@ class Event(IEvent):
3406
3406
  # Configure the trigger to execute the event every Monday at the specified hour, minute, and second.
3407
3407
  # The `CronTrigger` is used to specify the day of the week and time for the event.
3408
3408
  self.__trigger = CronTrigger(
3409
- day_of_week='mon', # Schedule the event for Mondays.
3410
- hour=hour, # Set the hour of execution.
3411
- minute=minute, # Set the minute of execution.
3412
- second=second, # Set the second of execution.
3413
- start_date=self.__start_date, # Restrict the schedule start if set.
3414
- end_date=self.__end_date, # Restrict the schedule end if set.
3415
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3409
+ day_of_week='mon', # Schedule the event for Mondays.
3410
+ hour=hour, # Set the hour of execution.
3411
+ minute=minute, # Set the minute of execution.
3412
+ second=second, # Set the second of execution.
3413
+ start_date=self.__start_date, # Restrict the schedule start if set.
3414
+ end_date=self.__end_date, # Restrict the schedule end if set.
3415
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3416
3416
  )
3417
3417
 
3418
3418
  # Store a human-readable description of the schedule.
@@ -3423,7 +3423,7 @@ class Event(IEvent):
3423
3423
 
3424
3424
  def everyTuesdayAt(
3425
3425
  self,
3426
- hour: int = 0,
3426
+ hour: int,
3427
3427
  minute: int = 0,
3428
3428
  second: int = 0
3429
3429
  ) -> bool:
@@ -3438,7 +3438,7 @@ class Event(IEvent):
3438
3438
  Parameters
3439
3439
  ----------
3440
3440
  hour : int, optional
3441
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3441
+ The hour of the day when the event should run. Must be in the range [0, 23].
3442
3442
  minute : int, optional
3443
3443
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3444
3444
  second : int, optional
@@ -3476,13 +3476,13 @@ class Event(IEvent):
3476
3476
 
3477
3477
  # Configure the trigger to execute the event every Tuesday at the specified hour, minute, and second.
3478
3478
  self.__trigger = CronTrigger(
3479
- day_of_week='tue', # Schedule the event for Tuesdays.
3480
- hour=hour, # Set the hour of execution.
3481
- minute=minute, # Set the minute of execution.
3482
- second=second, # Set the second of execution.
3483
- start_date=self.__start_date, # Restrict the schedule start if set.
3484
- end_date=self.__end_date, # Restrict the schedule end if set.
3485
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3479
+ day_of_week='tue', # Schedule the event for Tuesdays.
3480
+ hour=hour, # Set the hour of execution.
3481
+ minute=minute, # Set the minute of execution.
3482
+ second=second, # Set the second of execution.
3483
+ start_date=self.__start_date, # Restrict the schedule start if set.
3484
+ end_date=self.__end_date, # Restrict the schedule end if set.
3485
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3486
3486
  )
3487
3487
 
3488
3488
  # Store a human-readable description of the schedule.
@@ -3493,7 +3493,7 @@ class Event(IEvent):
3493
3493
 
3494
3494
  def everyWednesdayAt(
3495
3495
  self,
3496
- hour: int = 0,
3496
+ hour: int,
3497
3497
  minute: int = 0,
3498
3498
  second: int = 0
3499
3499
  ) -> bool:
@@ -3508,7 +3508,7 @@ class Event(IEvent):
3508
3508
  Parameters
3509
3509
  ----------
3510
3510
  hour : int, optional
3511
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3511
+ The hour of the day when the event should run. Must be in the range [0, 23].
3512
3512
  minute : int, optional
3513
3513
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3514
3514
  second : int, optional
@@ -3546,13 +3546,13 @@ class Event(IEvent):
3546
3546
 
3547
3547
  # Configure the trigger to execute the event every Wednesday at the specified hour, minute, and second.
3548
3548
  self.__trigger = CronTrigger(
3549
- day_of_week='wed', # Schedule the event for Wednesdays.
3550
- hour=hour, # Set the hour of execution.
3551
- minute=minute, # Set the minute of execution.
3552
- second=second, # Set the second of execution.
3553
- start_date=self.__start_date, # Restrict the schedule start if set.
3554
- end_date=self.__end_date, # Restrict the schedule end if set.
3555
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3549
+ day_of_week='wed', # Schedule the event for Wednesdays.
3550
+ hour=hour, # Set the hour of execution.
3551
+ minute=minute, # Set the minute of execution.
3552
+ second=second, # Set the second of execution.
3553
+ start_date=self.__start_date, # Restrict the schedule start if set.
3554
+ end_date=self.__end_date, # Restrict the schedule end if set.
3555
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3556
3556
  )
3557
3557
 
3558
3558
  # Store a human-readable description of the schedule.
@@ -3563,7 +3563,7 @@ class Event(IEvent):
3563
3563
 
3564
3564
  def everyThursdayAt(
3565
3565
  self,
3566
- hour: int = 0,
3566
+ hour: int,
3567
3567
  minute: int = 0,
3568
3568
  second: int = 0
3569
3569
  ) -> bool:
@@ -3578,7 +3578,7 @@ class Event(IEvent):
3578
3578
  Parameters
3579
3579
  ----------
3580
3580
  hour : int, optional
3581
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3581
+ The hour of the day when the event should run. Must be in the range [0, 23].
3582
3582
  minute : int, optional
3583
3583
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3584
3584
  second : int, optional
@@ -3616,13 +3616,13 @@ class Event(IEvent):
3616
3616
 
3617
3617
  # Configure the trigger to execute the event every Thursday at the specified hour, minute, and second.
3618
3618
  self.__trigger = CronTrigger(
3619
- day_of_week='thu', # Schedule the event for Thursdays.
3620
- hour=hour, # Set the hour of execution.
3621
- minute=minute, # Set the minute of execution.
3622
- second=second, # Set the second of execution.
3623
- start_date=self.__start_date, # Restrict the schedule start if set.
3624
- end_date=self.__end_date, # Restrict the schedule end if set.
3625
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3619
+ day_of_week='thu', # Schedule the event for Thursdays.
3620
+ hour=hour, # Set the hour of execution.
3621
+ minute=minute, # Set the minute of execution.
3622
+ second=second, # Set the second of execution.
3623
+ start_date=self.__start_date, # Restrict the schedule start if set.
3624
+ end_date=self.__end_date, # Restrict the schedule end if set.
3625
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3626
3626
  )
3627
3627
 
3628
3628
  # Store a human-readable description of the schedule.
@@ -3633,7 +3633,7 @@ class Event(IEvent):
3633
3633
 
3634
3634
  def everyFridayAt(
3635
3635
  self,
3636
- hour: int = 0,
3636
+ hour: int,
3637
3637
  minute: int = 0,
3638
3638
  second: int = 0
3639
3639
  ) -> bool:
@@ -3648,7 +3648,7 @@ class Event(IEvent):
3648
3648
  Parameters
3649
3649
  ----------
3650
3650
  hour : int, optional
3651
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3651
+ The hour of the day when the event should run. Must be in the range [0, 23].
3652
3652
  minute : int, optional
3653
3653
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3654
3654
  second : int, optional
@@ -3686,13 +3686,13 @@ class Event(IEvent):
3686
3686
 
3687
3687
  # Configure the trigger to execute the event every Friday at the specified hour, minute, and second.
3688
3688
  self.__trigger = CronTrigger(
3689
- day_of_week='fri', # Schedule the event for Fridays.
3690
- hour=hour, # Set the hour of execution.
3691
- minute=minute, # Set the minute of execution.
3692
- second=second, # Set the second of execution.
3693
- start_date=self.__start_date, # Restrict the schedule start if set.
3694
- end_date=self.__end_date, # Restrict the schedule end if set.
3695
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3689
+ day_of_week='fri', # Schedule the event for Fridays.
3690
+ hour=hour, # Set the hour of execution.
3691
+ minute=minute, # Set the minute of execution.
3692
+ second=second, # Set the second of execution.
3693
+ start_date=self.__start_date, # Restrict the schedule start if set.
3694
+ end_date=self.__end_date, # Restrict the schedule end if set.
3695
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3696
3696
  )
3697
3697
 
3698
3698
  # Store a human-readable description of the schedule.
@@ -3703,7 +3703,7 @@ class Event(IEvent):
3703
3703
 
3704
3704
  def everySaturdayAt(
3705
3705
  self,
3706
- hour: int = 0,
3706
+ hour: int,
3707
3707
  minute: int = 0,
3708
3708
  second: int = 0
3709
3709
  ) -> bool:
@@ -3718,7 +3718,7 @@ class Event(IEvent):
3718
3718
  Parameters
3719
3719
  ----------
3720
3720
  hour : int, optional
3721
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3721
+ The hour of the day when the event should run. Must be in the range [0, 23].
3722
3722
  minute : int, optional
3723
3723
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3724
3724
  second : int, optional
@@ -3773,7 +3773,7 @@ class Event(IEvent):
3773
3773
 
3774
3774
  def everySundayAt(
3775
3775
  self,
3776
- hour: int = 0,
3776
+ hour: int,
3777
3777
  minute: int = 0,
3778
3778
  second: int = 0
3779
3779
  ) -> bool:
@@ -3787,8 +3787,8 @@ class Event(IEvent):
3787
3787
 
3788
3788
  Parameters
3789
3789
  ----------
3790
- hour : int, optional
3791
- The hour of the day when the event should run. Must be in the range [0, 23]. Default is 0.
3790
+ hour : int
3791
+ The hour of the day when the event should run. Must be in the range [0, 23].
3792
3792
  minute : int, optional
3793
3793
  The minute of the hour when the event should run. Must be in the range [0, 59]. Default is 0.
3794
3794
  second : int, optional
@@ -3826,13 +3826,13 @@ class Event(IEvent):
3826
3826
 
3827
3827
  # Configure the trigger to execute the event every Sunday at the specified hour, minute, and second.
3828
3828
  self.__trigger = CronTrigger(
3829
- day_of_week='sun', # Schedule the event for Sundays.
3830
- hour=hour, # Set the hour of execution.
3831
- minute=minute, # Set the minute of execution.
3832
- second=second, # Set the second of execution.
3833
- start_date=self.__start_date, # Restrict the schedule start if set.
3834
- end_date=self.__end_date, # Restrict the schedule end if set.
3835
- jitter=self.__random_delay # Apply random delay (jitter) if configured.
3829
+ day_of_week='sun', # Schedule the event for Sundays.
3830
+ hour=hour, # Set the hour of execution.
3831
+ minute=minute, # Set the minute of execution.
3832
+ second=second, # Set the second of execution.
3833
+ start_date=self.__start_date, # Restrict the schedule start if set.
3834
+ end_date=self.__end_date, # Restrict the schedule end if set.
3835
+ jitter=self.__random_delay # Apply random delay (jitter) if configured.
3836
3836
  )
3837
3837
 
3838
3838
  # Store a human-readable description of the schedule.
@@ -3864,13 +3864,15 @@ class Event(IEvent):
3864
3864
  be applied to the trigger.
3865
3865
  """
3866
3866
 
3867
- # Configure the trigger to execute the event every week using an IntervalTrigger.
3868
- # Apply any configured start_date, end_date, and random_delay (jitter).
3869
- self.__trigger = IntervalTrigger(
3870
- weeks=1,
3871
- start_date=self.__start_date, # Restrict the schedule start if set.
3872
- end_date=self.__end_date, # Restrict the schedule end if set.
3873
- jitter=self.__random_delay # Apply random delay if configured.
3867
+ # Configure the trigger to execute the event every week.
3868
+ self.__trigger = CronTrigger(
3869
+ day_of_week='sun',
3870
+ hour=0,
3871
+ minute=0,
3872
+ second=0,
3873
+ start_date=self.__start_date,
3874
+ end_date=self.__end_date,
3875
+ jitter=self.__random_delay
3874
3876
  )
3875
3877
 
3876
3878
  # Store a human-readable description of the schedule for reference or logging.
@@ -72,6 +72,13 @@ class Schedule(ISchedule):
72
72
  and prepares all required internal structures for scheduling and event handling.
73
73
  """
74
74
 
75
+ # List of operations that can be performed on the scheduler
76
+ self.__operations = [
77
+ 'schedule:pause',
78
+ 'schedule:resume',
79
+ 'schedule:shutdown'
80
+ ]
81
+
75
82
  # Store the application instance for configuration and service access.
76
83
  self.__app: IApplication = app
77
84
 
@@ -1342,12 +1349,13 @@ class Schedule(ISchedule):
1342
1349
 
1343
1350
  # Iterate through each job and attempt to pause it
1344
1351
  for job in all_jobs:
1352
+
1345
1353
  try:
1346
1354
  # Get the job ID safely
1347
1355
  job_id = self.__getAttribute(job, 'id', None)
1348
1356
 
1349
- # Skip jobs without a valid ID
1350
- if not job_id:
1357
+ # Skip jobs without a valid user-defined ID (ignore system/operation jobs)
1358
+ if not job_id or not isinstance(job_id, str) or job_id.strip() == "" or job_id in self.__operations:
1351
1359
  continue
1352
1360
 
1353
1361
  # Pause the job in the scheduler
@@ -1909,6 +1917,24 @@ class Schedule(ISchedule):
1909
1917
  # Return True if the scheduler is running, otherwise False
1910
1918
  return self.__scheduler.running
1911
1919
 
1920
+ def isPaused(self) -> bool:
1921
+ """
1922
+ Check if the scheduler is currently paused.
1923
+
1924
+ This method determines whether the scheduler is in a paused state by checking if there are
1925
+ any jobs that were paused using the `pause` method. If there are jobs in the internal set
1926
+ `__pausedByPauseEverything`, it indicates that the scheduler has been paused.
1927
+
1928
+ Returns
1929
+ -------
1930
+ bool
1931
+ True if the scheduler is currently paused (i.e., there are jobs in the paused set);
1932
+ False otherwise.
1933
+ """
1934
+
1935
+ # The scheduler is considered paused if there are any jobs in the paused set
1936
+ return len(self.__pausedByPauseEverything) > 0
1937
+
1912
1938
  def forceStop(self) -> None:
1913
1939
  """
1914
1940
  Forcefully stop the scheduler immediately, bypassing graceful shutdown.
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.621.0"
8
+ VERSION = "0.622.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.621.0
3
+ Version: 0.622.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -24,12 +24,12 @@ orionis/console/contracts/cli_request.py,sha256=qIV8ig8PG39LYp1acnUD8GYsNRSHncxI
24
24
  orionis/console/contracts/command.py,sha256=Wvm62hw2gDIPNmoEUFyhKUERjZ6wnAbI-UDY_5gJE24,3626
25
25
  orionis/console/contracts/console.py,sha256=phaQhCLWa81MLzB5ydOSaUfEIdDq7fOjvym8Rmi-arc,11908
26
26
  orionis/console/contracts/debug.py,sha256=tEdF3_HJwDAgccXVEk_LGf43Am2ylbcx9i0Qvj3MFyU,1011
27
- orionis/console/contracts/event.py,sha256=Iu03z04ujkiYl6DksYT8QVXSJGabd5T_5dT67UozeCw,119978
27
+ orionis/console/contracts/event.py,sha256=KQESAycPzBE3xoDTnbYLz_XXg-7dwrybYKbaJjgkCMY,119842
28
28
  orionis/console/contracts/executor.py,sha256=JAzK64_5HfIGm3_BwsUv7-ZeC2Y-3mpxOByHaXwuy9A,4278
29
29
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
30
30
  orionis/console/contracts/progress_bar.py,sha256=NYebL2h-vg2t2H6IhJjuC37gglRkpT-MW71wbJtpLNg,1784
31
31
  orionis/console/contracts/reactor.py,sha256=iT6ShoCutAWEeJzOf_PK7CGXi9TgrOD5tewHFVQ2NQw,6075
32
- orionis/console/contracts/schedule.py,sha256=CHZ0qf9awMqy19uqNeDr-mNqqRc4X961kLcA0m0exLs,13080
32
+ orionis/console/contracts/schedule.py,sha256=xtXgp4BPhvhg3YSM4mrIdbyoBdr4OJBi1gBM_kJN5UQ,13694
33
33
  orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JXdUDHlQW19BX9lA09Qrh2QXg,3818
34
34
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  orionis/console/core/reactor.py,sha256=6scyrKukt6BEcLBxIrfAKA8QYnvNTl2dXePw6IWGPUw,43831
@@ -55,7 +55,7 @@ orionis/console/exceptions/__init__.py,sha256=rY9PE85TO_HpI5cfGWbZSDzk5aOUjErqBZ
55
55
  orionis/console/exceptions/cli_exceptions.py,sha256=nk3EGkRheDbw8vrxKgUxkAAPA6gPpO2dE5nDeVHJHA0,3580
56
56
  orionis/console/fluent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  orionis/console/fluent/command.py,sha256=0jyhB45LIjDS7nkjNhkkvEXEzdOBmT49qKIooYY_DbI,8261
58
- orionis/console/fluent/event.py,sha256=kEynb0mQDyEiTiEnctoJoPizFfe0TkySOsMaECob3UY,166495
58
+ orionis/console/fluent/event.py,sha256=RM6Aaz-2MYQg4RWxYdr6oBNaAjNVp9DE_tI5iwl2mAk,166672
59
59
  orionis/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  orionis/console/output/console.py,sha256=EtSDWRBW8wk0iJdPfB1mzU49krLJBaSAUdVdVOzzhQ4,17888
61
61
  orionis/console/output/executor.py,sha256=uQjFPOlyZLFj9pcyYPugCqxwJog0AJgK1OcmQH2ELbw,7314
@@ -64,7 +64,7 @@ orionis/console/request/cli_request.py,sha256=lO7088xlVK1VP-NhCIgAo7qXGzCW3nXVOJ
64
64
  orionis/console/stub/command.stub,sha256=IfQ0bTrpataVFcT1ZdHyyiYNZ67D5Aox_QvgVJLeJnI,1240
65
65
  orionis/console/stub/listener.stub,sha256=DbX-ghx2-vb73kzQ6L20lyg5vSKn58jSLTwFuwNQU9k,4331
66
66
  orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- orionis/console/tasks/schedule.py,sha256=0P600_2JiA3ON9gqKNruEBGlQpMCGZW10pw3pXqH0bI,86912
67
+ orionis/console/tasks/schedule.py,sha256=Evlqlz-hsOyEzPrkuHApYlG-aBputrShBkIMmdLaqnw,87976
68
68
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  orionis/container/container.py,sha256=yfhRs85YpPvqGRfrjblkHEuZGCN0BijremI-3r1Epak,96842
70
70
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -216,7 +216,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
216
216
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
217
217
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
218
218
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=lbvbicyGSvxD7hHMZszvxPibTTbu-sMZ5D2ru8djvdU,4109
219
+ orionis/metadata/framework.py,sha256=3c636E6HS3G-0vSPyERKJhYAs2M_GaVvVTYQLZ72LEE,4109
220
220
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
221
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
222
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -403,8 +403,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
403
403
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
404
404
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
405
405
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
406
- orionis-0.621.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
- orionis-0.621.0.dist-info/METADATA,sha256=G6IePwko5jyIq0Ywu5X5uSepzFGUM_mTQZDvfAbs6E4,4801
408
- orionis-0.621.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
- orionis-0.621.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
- orionis-0.621.0.dist-info/RECORD,,
406
+ orionis-0.622.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
+ orionis-0.622.0.dist-info/METADATA,sha256=Xgen5LEVWbhYuZ6eyXEoGmwo-GV4mGJR5lZSOfDOxtQ,4801
408
+ orionis-0.622.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
+ orionis-0.622.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
+ orionis-0.622.0.dist-info/RECORD,,