orionis 0.516.0__py3-none-any.whl → 0.518.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.
- orionis/console/base/scheduler.py +110 -35
- orionis/console/contracts/scheduler.py +105 -56
- orionis/console/tasks/schedule.py +10 -46
- orionis/metadata/framework.py +1 -1
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/METADATA +1 -1
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/RECORD +10 -10
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/WHEEL +0 -0
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/top_level.txt +0 -0
- {orionis-0.516.0.dist-info → orionis-0.518.0.dist-info}/zip-safe +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from orionis.console.contracts.scheduler import IBaseScheduler
|
|
3
3
|
from orionis.console.contracts.schedule import ISchedule
|
|
4
|
+
from orionis.console.entities.job_error import JobError
|
|
5
|
+
from orionis.console.entities.scheduler_paused import SchedulerPaused
|
|
6
|
+
from orionis.console.entities.scheduler_resumed import SchedulerResumed
|
|
7
|
+
from orionis.console.entities.scheduler_shutdown import SchedulerShutdown
|
|
8
|
+
from orionis.console.entities.scheduler_started import SchedulerStarted
|
|
4
9
|
|
|
5
10
|
class BaseScheduler(IBaseScheduler):
|
|
6
11
|
|
|
@@ -13,10 +18,13 @@ class BaseScheduler(IBaseScheduler):
|
|
|
13
18
|
# Finalize Global Scheduler at a specific time
|
|
14
19
|
FINALIZE_AT: datetime = None
|
|
15
20
|
|
|
16
|
-
def tasks(self, schedule: ISchedule):
|
|
21
|
+
async def tasks(self, schedule: ISchedule):
|
|
17
22
|
"""
|
|
18
23
|
Defines and registers scheduled tasks for the application.
|
|
19
24
|
|
|
25
|
+
This method is responsible for setting up the tasks that the scheduler will execute.
|
|
26
|
+
It uses the provided `schedule` object to define the properties and behavior of each task.
|
|
27
|
+
|
|
20
28
|
Parameters
|
|
21
29
|
----------
|
|
22
30
|
schedule : ISchedule
|
|
@@ -25,96 +33,163 @@ class BaseScheduler(IBaseScheduler):
|
|
|
25
33
|
Returns
|
|
26
34
|
-------
|
|
27
35
|
None
|
|
28
|
-
This method does not return any value. It is
|
|
29
|
-
|
|
36
|
+
This method does not return any value. It is used solely for task registration.
|
|
37
|
+
|
|
38
|
+
Notes
|
|
39
|
+
-----
|
|
40
|
+
Subclasses must override this method to implement their specific task scheduling logic.
|
|
41
|
+
The method should define the tasks, their execution intervals, and any additional
|
|
42
|
+
properties or constraints required for the tasks.
|
|
30
43
|
"""
|
|
31
|
-
# Placeholder for task registration logic
|
|
32
|
-
pass
|
|
33
44
|
|
|
34
|
-
|
|
45
|
+
# Raise an error to enforce implementation in subclasses
|
|
46
|
+
raise NotImplementedError("Subclasses must implement the tasks method.")
|
|
47
|
+
|
|
48
|
+
async def onStarted(self, event: SchedulerStarted, schedule: ISchedule):
|
|
35
49
|
"""
|
|
36
|
-
|
|
50
|
+
Handles the event triggered when the scheduler has started successfully.
|
|
51
|
+
|
|
52
|
+
This method is invoked when the scheduler begins its operation. It processes
|
|
53
|
+
the `SchedulerStarted` event and performs any necessary initialization or logging
|
|
54
|
+
tasks associated with the start of the scheduler.
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
58
|
+
event : SchedulerStarted
|
|
59
|
+
The event object containing details about the scheduler start event.
|
|
60
|
+
schedule : ISchedule
|
|
61
|
+
The schedule instance associated with the started scheduler.
|
|
37
62
|
|
|
38
63
|
Returns
|
|
39
64
|
-------
|
|
40
65
|
None
|
|
41
|
-
This method does not return any value.
|
|
66
|
+
This method does not return any value. It is used for handling the
|
|
67
|
+
scheduler start event and performing related actions.
|
|
42
68
|
|
|
43
69
|
Notes
|
|
44
70
|
-----
|
|
45
|
-
|
|
46
|
-
|
|
71
|
+
This method calls the parent class's `onStarted` method to ensure that
|
|
72
|
+
any base functionality is executed.
|
|
47
73
|
"""
|
|
48
|
-
# Placeholder for logic to execute when the scheduler starts
|
|
49
74
|
pass
|
|
50
75
|
|
|
51
|
-
def onPaused(self):
|
|
76
|
+
async def onPaused(self, event: SchedulerPaused, schedule: ISchedule):
|
|
52
77
|
"""
|
|
53
|
-
|
|
78
|
+
Handles the event triggered when the scheduler is paused.
|
|
79
|
+
|
|
80
|
+
This method is invoked when the scheduler pauses its operation. It processes
|
|
81
|
+
the `SchedulerPaused` event and performs any necessary actions or logging
|
|
82
|
+
tasks associated with the pause of the scheduler.
|
|
83
|
+
|
|
84
|
+
Parameters
|
|
85
|
+
----------
|
|
86
|
+
event : SchedulerPaused
|
|
87
|
+
The event object containing details about the scheduler pause event.
|
|
88
|
+
schedule : ISchedule
|
|
89
|
+
The schedule instance associated with the paused scheduler.
|
|
54
90
|
|
|
55
91
|
Returns
|
|
56
92
|
-------
|
|
57
93
|
None
|
|
58
|
-
This method does not return any value.
|
|
94
|
+
This method does not return any value. It is used for handling the
|
|
95
|
+
scheduler pause event and performing related actions.
|
|
59
96
|
|
|
60
97
|
Notes
|
|
61
98
|
-----
|
|
62
|
-
|
|
63
|
-
|
|
99
|
+
This method calls the parent class's `onPaused` method to ensure that
|
|
100
|
+
any base functionality is executed.
|
|
64
101
|
"""
|
|
65
|
-
# Placeholder for logic to execute when the scheduler is paused
|
|
66
102
|
pass
|
|
67
103
|
|
|
68
|
-
def onResumed(self):
|
|
104
|
+
async def onResumed(self, event: SchedulerResumed, schedule: ISchedule):
|
|
69
105
|
"""
|
|
70
|
-
|
|
106
|
+
Handles the event triggered when the scheduler is resumed.
|
|
107
|
+
|
|
108
|
+
This method is invoked when the scheduler resumes its operation after being paused.
|
|
109
|
+
It processes the `SchedulerResumed` event and performs any necessary actions or logging
|
|
110
|
+
tasks associated with the resumption of the scheduler.
|
|
111
|
+
|
|
112
|
+
Parameters
|
|
113
|
+
----------
|
|
114
|
+
event : SchedulerResumed
|
|
115
|
+
The event object containing details about the scheduler resumption, such as the
|
|
116
|
+
timestamp of the resumption and any relevant metadata.
|
|
117
|
+
schedule : ISchedule
|
|
118
|
+
The schedule instance associated with the resumed scheduler, which can be used
|
|
119
|
+
to interact with or modify the scheduler's tasks.
|
|
71
120
|
|
|
72
121
|
Returns
|
|
73
122
|
-------
|
|
74
123
|
None
|
|
75
|
-
This method does not return any value.
|
|
124
|
+
This method does not return any value. It is used for handling the scheduler
|
|
125
|
+
resumption event and performing related actions.
|
|
76
126
|
|
|
77
127
|
Notes
|
|
78
128
|
-----
|
|
79
|
-
|
|
80
|
-
scheduler
|
|
129
|
+
This method calls the parent class's `onResumed` method to ensure that any base
|
|
130
|
+
functionality is executed. This allows the scheduler to maintain its default behavior
|
|
131
|
+
while enabling additional custom actions during the resumption process.
|
|
81
132
|
"""
|
|
82
|
-
# Placeholder for logic to execute when the scheduler is resumed
|
|
83
133
|
pass
|
|
84
134
|
|
|
85
|
-
def onFinalized(self):
|
|
135
|
+
async def onFinalized(self, event: SchedulerShutdown, schedule: ISchedule):
|
|
86
136
|
"""
|
|
87
|
-
|
|
137
|
+
Handles the event triggered when the scheduler has been finalized.
|
|
138
|
+
|
|
139
|
+
This method is invoked after the scheduler has completed its shutdown process.
|
|
140
|
+
It processes the `SchedulerShutdown` event and performs any necessary cleanup
|
|
141
|
+
or logging tasks associated with the finalization of the scheduler.
|
|
142
|
+
|
|
143
|
+
Parameters
|
|
144
|
+
----------
|
|
145
|
+
event : SchedulerShutdown
|
|
146
|
+
The event object containing details about the scheduler shutdown, such as
|
|
147
|
+
the timestamp of the shutdown and any relevant metadata.
|
|
148
|
+
schedule : ISchedule
|
|
149
|
+
The schedule instance associated with the finalized scheduler, which can be
|
|
150
|
+
used to interact with or inspect the scheduler's tasks.
|
|
88
151
|
|
|
89
152
|
Returns
|
|
90
153
|
-------
|
|
91
154
|
None
|
|
92
|
-
This method does not return any value.
|
|
155
|
+
This method does not return any value. It is used for handling the scheduler
|
|
156
|
+
shutdown event and performing related actions.
|
|
93
157
|
|
|
94
158
|
Notes
|
|
95
159
|
-----
|
|
96
|
-
|
|
160
|
+
This method calls the parent class's `onFinalized` method to ensure that any base
|
|
161
|
+
functionality is executed. This allows the scheduler to maintain its default behavior
|
|
162
|
+
while enabling additional custom actions during the finalization process.
|
|
97
163
|
"""
|
|
98
|
-
# Placeholder for logic to execute when the scheduler is finalized
|
|
99
164
|
pass
|
|
100
165
|
|
|
101
|
-
def onError(self,
|
|
166
|
+
async def onError(self, event: JobError, schedule: ISchedule):
|
|
102
167
|
"""
|
|
103
|
-
Handles
|
|
168
|
+
Handles the event triggered when a job encounters an error during execution.
|
|
169
|
+
|
|
170
|
+
This method is invoked when a job fails due to an exception. It processes the `JobError`
|
|
171
|
+
event and performs any necessary actions, such as logging the error details or notifying
|
|
172
|
+
relevant systems about the failure.
|
|
104
173
|
|
|
105
174
|
Parameters
|
|
106
175
|
----------
|
|
107
|
-
|
|
108
|
-
The
|
|
176
|
+
event : JobError
|
|
177
|
+
The event object containing details about the job error, including the job ID,
|
|
178
|
+
the exception that occurred, and any relevant metadata.
|
|
179
|
+
schedule : ISchedule
|
|
180
|
+
The schedule instance associated with the job, which can be used to interact with
|
|
181
|
+
or modify the scheduler's tasks.
|
|
109
182
|
|
|
110
183
|
Returns
|
|
111
184
|
-------
|
|
112
185
|
None
|
|
113
|
-
This method does not return any value.
|
|
186
|
+
This method does not return any value. It is used for handling the job error event
|
|
187
|
+
and performing related actions, such as logging or cleanup.
|
|
114
188
|
|
|
115
189
|
Notes
|
|
116
190
|
-----
|
|
117
|
-
|
|
191
|
+
This method calls the parent class's `onError` method to ensure that any base functionality
|
|
192
|
+
is executed. This allows the scheduler to maintain its default behavior while enabling
|
|
193
|
+
additional custom actions during error handling.
|
|
118
194
|
"""
|
|
119
|
-
# Placeholder for logic to handle errors in the scheduler
|
|
120
195
|
pass
|
|
@@ -1,140 +1,189 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
|
-
from datetime import datetime
|
|
3
2
|
from orionis.console.contracts.schedule import ISchedule
|
|
3
|
+
from orionis.console.entities.job_error import JobError
|
|
4
|
+
from orionis.console.entities.scheduler_paused import SchedulerPaused
|
|
5
|
+
from orionis.console.entities.scheduler_resumed import SchedulerResumed
|
|
6
|
+
from orionis.console.entities.scheduler_shutdown import SchedulerShutdown
|
|
7
|
+
from orionis.console.entities.scheduler_started import SchedulerStarted
|
|
4
8
|
|
|
5
9
|
class IBaseScheduler(ABC):
|
|
6
10
|
|
|
7
|
-
# Pause Global Scheduler at a specific time
|
|
8
|
-
PAUSE_AT: datetime = None
|
|
9
|
-
|
|
10
|
-
# Resume Global Scheduler at a specific time
|
|
11
|
-
RESUME_AT: datetime = None
|
|
12
|
-
|
|
13
|
-
# Finalize Global Scheduler at a specific time
|
|
14
|
-
FINALIZE_AT: datetime = None
|
|
15
|
-
|
|
16
11
|
@abstractmethod
|
|
17
|
-
def tasks(self, schedule: ISchedule):
|
|
12
|
+
async def tasks(self, schedule: ISchedule):
|
|
18
13
|
"""
|
|
19
14
|
Defines and registers scheduled tasks for the application.
|
|
20
15
|
|
|
16
|
+
This method is responsible for setting up the tasks that the scheduler will execute.
|
|
17
|
+
It uses the provided `schedule` object to define the properties and behavior of each task.
|
|
18
|
+
|
|
21
19
|
Parameters
|
|
22
20
|
----------
|
|
23
21
|
schedule : ISchedule
|
|
24
|
-
The schedule object used to define and register scheduled commands.
|
|
25
|
-
This object provides methods to add tasks to the scheduler.
|
|
22
|
+
The schedule object used to define and register scheduled commands.
|
|
26
23
|
|
|
27
24
|
Returns
|
|
28
25
|
-------
|
|
29
26
|
None
|
|
30
|
-
This method does not return any value. It is
|
|
31
|
-
by subclasses to specify scheduled tasks.
|
|
27
|
+
This method does not return any value. It is used solely for task registration.
|
|
32
28
|
|
|
33
29
|
Notes
|
|
34
30
|
-----
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
Subclasses must override this method to implement their specific task scheduling logic.
|
|
32
|
+
The method should define the tasks, their execution intervals, and any additional
|
|
33
|
+
properties or constraints required for the tasks.
|
|
38
34
|
"""
|
|
39
|
-
# Abstract method to be implemented by subclasses for task registration
|
|
40
35
|
pass
|
|
41
36
|
|
|
42
37
|
@abstractmethod
|
|
43
|
-
def onStarted(self):
|
|
38
|
+
async def onStarted(self, event: SchedulerStarted, schedule: ISchedule):
|
|
44
39
|
"""
|
|
45
|
-
|
|
40
|
+
Handles the event triggered when the scheduler has started successfully.
|
|
41
|
+
|
|
42
|
+
This method is invoked when the scheduler begins its operation. It processes
|
|
43
|
+
the `SchedulerStarted` event and performs any necessary initialization or logging
|
|
44
|
+
tasks associated with the start of the scheduler.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
event : SchedulerStarted
|
|
49
|
+
The event object containing details about the scheduler start event.
|
|
50
|
+
schedule : ISchedule
|
|
51
|
+
The schedule instance associated with the started scheduler.
|
|
46
52
|
|
|
47
53
|
Returns
|
|
48
54
|
-------
|
|
49
55
|
None
|
|
50
|
-
This method does not return any value.
|
|
56
|
+
This method does not return any value. It is used for handling the
|
|
57
|
+
scheduler start event and performing related actions.
|
|
51
58
|
|
|
52
59
|
Notes
|
|
53
60
|
-----
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
resources or logging the start event.
|
|
61
|
+
This method calls the parent class's `onStarted` method to ensure that
|
|
62
|
+
any base functionality is executed.
|
|
57
63
|
"""
|
|
58
|
-
# Abstract method to define behavior when the scheduler starts
|
|
59
64
|
pass
|
|
60
65
|
|
|
61
66
|
@abstractmethod
|
|
62
|
-
def onPaused(self):
|
|
67
|
+
async def onPaused(self, event: SchedulerPaused, schedule: ISchedule):
|
|
63
68
|
"""
|
|
64
|
-
|
|
69
|
+
Handles the event triggered when the scheduler is paused.
|
|
70
|
+
|
|
71
|
+
This method is invoked when the scheduler pauses its operation. It processes
|
|
72
|
+
the `SchedulerPaused` event and performs any necessary actions or logging
|
|
73
|
+
tasks associated with the pause of the scheduler.
|
|
74
|
+
|
|
75
|
+
Parameters
|
|
76
|
+
----------
|
|
77
|
+
event : SchedulerPaused
|
|
78
|
+
The event object containing details about the scheduler pause event.
|
|
79
|
+
schedule : ISchedule
|
|
80
|
+
The schedule instance associated with the paused scheduler.
|
|
65
81
|
|
|
66
82
|
Returns
|
|
67
83
|
-------
|
|
68
84
|
None
|
|
69
|
-
This method does not return any value.
|
|
85
|
+
This method does not return any value. It is used for handling the
|
|
86
|
+
scheduler pause event and performing related actions.
|
|
70
87
|
|
|
71
88
|
Notes
|
|
72
89
|
-----
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
state or logging the pause event.
|
|
90
|
+
This method calls the parent class's `onPaused` method to ensure that
|
|
91
|
+
any base functionality is executed.
|
|
76
92
|
"""
|
|
77
|
-
# Abstract method to define behavior when the scheduler is paused
|
|
78
93
|
pass
|
|
79
94
|
|
|
80
95
|
@abstractmethod
|
|
81
|
-
def onResumed(self):
|
|
96
|
+
async def onResumed(self, event: SchedulerResumed, schedule: ISchedule):
|
|
82
97
|
"""
|
|
83
|
-
|
|
98
|
+
Handles the event triggered when the scheduler is resumed.
|
|
99
|
+
|
|
100
|
+
This method is invoked when the scheduler resumes its operation after being paused.
|
|
101
|
+
It processes the `SchedulerResumed` event and performs any necessary actions or logging
|
|
102
|
+
tasks associated with the resumption of the scheduler.
|
|
103
|
+
|
|
104
|
+
Parameters
|
|
105
|
+
----------
|
|
106
|
+
event : SchedulerResumed
|
|
107
|
+
The event object containing details about the scheduler resumption, such as the
|
|
108
|
+
timestamp of the resumption and any relevant metadata.
|
|
109
|
+
schedule : ISchedule
|
|
110
|
+
The schedule instance associated with the resumed scheduler, which can be used
|
|
111
|
+
to interact with or modify the scheduler's tasks.
|
|
84
112
|
|
|
85
113
|
Returns
|
|
86
114
|
-------
|
|
87
115
|
None
|
|
88
|
-
This method does not return any value.
|
|
116
|
+
This method does not return any value. It is used for handling the scheduler
|
|
117
|
+
resumption event and performing related actions.
|
|
89
118
|
|
|
90
119
|
Notes
|
|
91
120
|
-----
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
121
|
+
This method calls the parent class's `onResumed` method to ensure that any base
|
|
122
|
+
functionality is executed. This allows the scheduler to maintain its default behavior
|
|
123
|
+
while enabling additional custom actions during the resumption process.
|
|
95
124
|
"""
|
|
96
|
-
# Abstract method to define behavior when the scheduler is resumed
|
|
97
125
|
pass
|
|
98
126
|
|
|
99
127
|
@abstractmethod
|
|
100
|
-
def onFinalized(self):
|
|
128
|
+
async def onFinalized(self, event: SchedulerShutdown, schedule: ISchedule):
|
|
101
129
|
"""
|
|
102
|
-
|
|
130
|
+
Handles the event triggered when the scheduler has been finalized.
|
|
131
|
+
|
|
132
|
+
This method is invoked after the scheduler has completed its shutdown process.
|
|
133
|
+
It processes the `SchedulerShutdown` event and performs any necessary cleanup
|
|
134
|
+
or logging tasks associated with the finalization of the scheduler.
|
|
135
|
+
|
|
136
|
+
Parameters
|
|
137
|
+
----------
|
|
138
|
+
event : SchedulerShutdown
|
|
139
|
+
The event object containing details about the scheduler shutdown, such as
|
|
140
|
+
the timestamp of the shutdown and any relevant metadata.
|
|
141
|
+
schedule : ISchedule
|
|
142
|
+
The schedule instance associated with the finalized scheduler, which can be
|
|
143
|
+
used to interact with or inspect the scheduler's tasks.
|
|
103
144
|
|
|
104
145
|
Returns
|
|
105
146
|
-------
|
|
106
147
|
None
|
|
107
|
-
This method does not return any value.
|
|
148
|
+
This method does not return any value. It is used for handling the scheduler
|
|
149
|
+
shutdown event and performing related actions.
|
|
108
150
|
|
|
109
151
|
Notes
|
|
110
152
|
-----
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
153
|
+
This method calls the parent class's `onFinalized` method to ensure that any base
|
|
154
|
+
functionality is executed. This allows the scheduler to maintain its default behavior
|
|
155
|
+
while enabling additional custom actions during the finalization process.
|
|
114
156
|
"""
|
|
115
|
-
# Abstract method to define behavior when the scheduler is finalized
|
|
116
157
|
pass
|
|
117
158
|
|
|
118
159
|
@abstractmethod
|
|
119
|
-
def onError(self,
|
|
160
|
+
async def onError(self, event: JobError, schedule: ISchedule):
|
|
120
161
|
"""
|
|
121
|
-
Handles
|
|
162
|
+
Handles the event triggered when a job encounters an error during execution.
|
|
163
|
+
|
|
164
|
+
This method is invoked when a job fails due to an exception. It processes the `JobError`
|
|
165
|
+
event and performs any necessary actions, such as logging the error details or notifying
|
|
166
|
+
relevant systems about the failure.
|
|
122
167
|
|
|
123
168
|
Parameters
|
|
124
169
|
----------
|
|
125
|
-
|
|
126
|
-
The
|
|
170
|
+
event : JobError
|
|
171
|
+
The event object containing details about the job error, including the job ID,
|
|
172
|
+
the exception that occurred, and any relevant metadata.
|
|
173
|
+
schedule : ISchedule
|
|
174
|
+
The schedule instance associated with the job, which can be used to interact with
|
|
175
|
+
or modify the scheduler's tasks.
|
|
127
176
|
|
|
128
177
|
Returns
|
|
129
178
|
-------
|
|
130
179
|
None
|
|
131
|
-
This method does not return any value.
|
|
180
|
+
This method does not return any value. It is used for handling the job error event
|
|
181
|
+
and performing related actions, such as logging or cleanup.
|
|
132
182
|
|
|
133
183
|
Notes
|
|
134
184
|
-----
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
185
|
+
This method calls the parent class's `onError` method to ensure that any base functionality
|
|
186
|
+
is executed. This allows the scheduler to maintain its default behavior while enabling
|
|
187
|
+
additional custom actions during error handling.
|
|
138
188
|
"""
|
|
139
|
-
# Abstract method to define behavior for handling errors in the scheduler
|
|
140
189
|
pass
|
|
@@ -3,6 +3,7 @@ from datetime import datetime
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Dict, List, Optional, Union
|
|
5
5
|
import pytz
|
|
6
|
+
from apscheduler.triggers.date import DateTrigger
|
|
6
7
|
from apscheduler.events import (
|
|
7
8
|
EVENT_SCHEDULER_STARTED,
|
|
8
9
|
EVENT_SCHEDULER_PAUSED,
|
|
@@ -524,10 +525,6 @@ class Scheduler(ISchedule):
|
|
|
524
525
|
# Log an informational message indicating that the scheduler has been paused
|
|
525
526
|
self.__logger.info(message)
|
|
526
527
|
|
|
527
|
-
# Display a paused message for the scheduler worker on console
|
|
528
|
-
if self.__app.config('app.debug', False):
|
|
529
|
-
self.__console.info(message)
|
|
530
|
-
|
|
531
528
|
# Check if a listener is registered for the scheduler started event
|
|
532
529
|
self.__globalCallableListener(event, ListeningEvent.SCHEDULER_PAUSED)
|
|
533
530
|
|
|
@@ -565,10 +562,6 @@ class Scheduler(ISchedule):
|
|
|
565
562
|
# Log an informational message indicating that the scheduler has resumed
|
|
566
563
|
self.__logger.info(message)
|
|
567
564
|
|
|
568
|
-
# Display a resumed message for the scheduler worker on console
|
|
569
|
-
if self.__app.config('app.debug', False):
|
|
570
|
-
self.__console.info(message)
|
|
571
|
-
|
|
572
565
|
# Check if a listener is registered for the scheduler started event
|
|
573
566
|
self.__globalCallableListener(event, ListeningEvent.SCHEDULER_RESUMED)
|
|
574
567
|
|
|
@@ -606,10 +599,6 @@ class Scheduler(ISchedule):
|
|
|
606
599
|
# Log an informational message indicating that the scheduler has shut down
|
|
607
600
|
self.__logger.info(message)
|
|
608
601
|
|
|
609
|
-
# Display a shutdown message for the scheduler worker on console
|
|
610
|
-
if self.__app.config('app.debug', False):
|
|
611
|
-
self.__console.info(message)
|
|
612
|
-
|
|
613
602
|
# Check if a listener is registered for the scheduler started event
|
|
614
603
|
self.__globalCallableListener(event, ListeningEvent.SCHEDULER_SHUTDOWN)
|
|
615
604
|
|
|
@@ -644,10 +633,6 @@ class Scheduler(ISchedule):
|
|
|
644
633
|
# Log an error message indicating that the job raised an exception
|
|
645
634
|
self.__logger.error(message)
|
|
646
635
|
|
|
647
|
-
# If the application is in debug mode, display a message on the console
|
|
648
|
-
if self.__app.config('app.debug', False):
|
|
649
|
-
self.__console.error(message)
|
|
650
|
-
|
|
651
636
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
652
637
|
self.__taskCallableListener(event, ListeningEvent.JOB_ON_FAILURE)
|
|
653
638
|
|
|
@@ -685,10 +670,6 @@ class Scheduler(ISchedule):
|
|
|
685
670
|
# Log an informational message indicating that the job has been submitted
|
|
686
671
|
self.__logger.info(message)
|
|
687
672
|
|
|
688
|
-
# If the application is in debug mode, display a message on the console
|
|
689
|
-
if self.__app.config('app.debug', False):
|
|
690
|
-
self.__console.info(message)
|
|
691
|
-
|
|
692
673
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
693
674
|
self.__taskCallableListener(event, ListeningEvent.JOB_BEFORE)
|
|
694
675
|
|
|
@@ -724,10 +705,6 @@ class Scheduler(ISchedule):
|
|
|
724
705
|
# Log an informational message indicating that the job has been executed
|
|
725
706
|
self.__logger.info(message)
|
|
726
707
|
|
|
727
|
-
# If the application is in debug mode, display a message on the console
|
|
728
|
-
if self.__app.config('app.debug', False):
|
|
729
|
-
self.__console.info(message)
|
|
730
|
-
|
|
731
708
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
732
709
|
self.__taskCallableListener(event, ListeningEvent.JOB_AFTER)
|
|
733
710
|
|
|
@@ -763,10 +740,6 @@ class Scheduler(ISchedule):
|
|
|
763
740
|
# Log a warning indicating that the job was missed
|
|
764
741
|
self.__logger.warning(message)
|
|
765
742
|
|
|
766
|
-
# If the application is in debug mode, report the missed job using the error reporter
|
|
767
|
-
if self.__app.config('app.debug', False):
|
|
768
|
-
self.__console.warning(message)
|
|
769
|
-
|
|
770
743
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
771
744
|
self.__taskCallableListener(event, ListeningEvent.JOB_ON_MISSED)
|
|
772
745
|
|
|
@@ -802,10 +775,6 @@ class Scheduler(ISchedule):
|
|
|
802
775
|
# Log an error message indicating that the job exceeded maximum instances
|
|
803
776
|
self.__logger.error(message)
|
|
804
777
|
|
|
805
|
-
# If the application is in debug mode, display a message on the console
|
|
806
|
-
if self.__app.config('app.debug', False):
|
|
807
|
-
self.__console.error(message)
|
|
808
|
-
|
|
809
778
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
810
779
|
self.__taskCallableListener(event, ListeningEvent.JOB_ON_MAXINSTANCES)
|
|
811
780
|
|
|
@@ -841,10 +810,6 @@ class Scheduler(ISchedule):
|
|
|
841
810
|
# Log an informational message indicating that the job has been modified
|
|
842
811
|
self.__logger.info(message)
|
|
843
812
|
|
|
844
|
-
# If the application is in debug mode, display a message on the console
|
|
845
|
-
if self.__app.config('app.debug', False):
|
|
846
|
-
self.__console.info(message)
|
|
847
|
-
|
|
848
813
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
849
814
|
if event.next_run_time is None:
|
|
850
815
|
self.__taskCallableListener(event, ListeningEvent.JOB_ON_PAUSED)
|
|
@@ -882,10 +847,6 @@ class Scheduler(ISchedule):
|
|
|
882
847
|
# Log the removal of the job
|
|
883
848
|
self.__logger.info(message)
|
|
884
849
|
|
|
885
|
-
# If the application is in debug mode, display the message on the console
|
|
886
|
-
if self.__app.config('app.debug', False):
|
|
887
|
-
self.__console.info(message)
|
|
888
|
-
|
|
889
850
|
# If a listener is registered for this job ID, invoke the listener with the event details
|
|
890
851
|
self.__taskCallableListener(event, ListeningEvent.JOB_ON_REMOVED)
|
|
891
852
|
|
|
@@ -1019,8 +980,7 @@ class Scheduler(ISchedule):
|
|
|
1019
980
|
# Add a job to the scheduler to pause it at the specified datetime
|
|
1020
981
|
self.__scheduler.add_job(
|
|
1021
982
|
func=self.__scheduler.pause, # Function to pause the scheduler
|
|
1022
|
-
trigger=
|
|
1023
|
-
run_date=at, # The datetime at which the job will run
|
|
983
|
+
trigger=DateTrigger(run_date=at), # Trigger type is 'date' for one-time execution
|
|
1024
984
|
id=f"pause_scheduler_at_{at.isoformat()}", # Unique job ID based on the datetime
|
|
1025
985
|
name=f"Pause Scheduler at {at.isoformat()}", # Descriptive name for the job
|
|
1026
986
|
replace_existing=True # Replace any existing job with the same ID
|
|
@@ -1062,8 +1022,7 @@ class Scheduler(ISchedule):
|
|
|
1062
1022
|
# Add a job to the scheduler to resume it at the specified datetime
|
|
1063
1023
|
self.__scheduler.add_job(
|
|
1064
1024
|
func=self.__scheduler.resume, # Function to resume the scheduler
|
|
1065
|
-
trigger=
|
|
1066
|
-
run_date=at, # The datetime at which the job will run
|
|
1025
|
+
trigger=DateTrigger(run_date=at), # Trigger type is 'date' for one-time execution
|
|
1067
1026
|
id=f"resume_scheduler_at_{at.isoformat()}", # Unique job ID based on the datetime
|
|
1068
1027
|
name=f"Resume Scheduler at {at.isoformat()}", # Descriptive name for the job
|
|
1069
1028
|
replace_existing=True # Replace any existing job with the same ID
|
|
@@ -1105,8 +1064,7 @@ class Scheduler(ISchedule):
|
|
|
1105
1064
|
# Add a job to the scheduler to shut it down at the specified datetime
|
|
1106
1065
|
self.__scheduler.add_job(
|
|
1107
1066
|
func=self.__scheduler.shutdown, # Function to shut down the scheduler
|
|
1108
|
-
trigger=
|
|
1109
|
-
run_date=at, # The datetime at which the job will run
|
|
1067
|
+
trigger=DateTrigger(run_date=at), # Trigger type is 'date' for one-time execution
|
|
1110
1068
|
id=f"shutdown_scheduler_at_{at.isoformat()}", # Unique job ID based on the datetime
|
|
1111
1069
|
name=f"Shutdown Scheduler at {at.isoformat()}", # Descriptive name for the job
|
|
1112
1070
|
replace_existing=True # Replace any existing job with the same ID
|
|
@@ -1245,6 +1203,8 @@ class Scheduler(ISchedule):
|
|
|
1245
1203
|
|
|
1246
1204
|
# Log the successful pausing of the job
|
|
1247
1205
|
self.__logger.info(f"Job '{signature}' has been paused.")
|
|
1206
|
+
|
|
1207
|
+
# Return True to indicate the job was successfully paused
|
|
1248
1208
|
return True
|
|
1249
1209
|
|
|
1250
1210
|
except Exception:
|
|
@@ -1288,6 +1248,8 @@ class Scheduler(ISchedule):
|
|
|
1288
1248
|
|
|
1289
1249
|
# Log the successful resumption of the job
|
|
1290
1250
|
self.__logger.info(f"Job '{signature}' has been resumed.")
|
|
1251
|
+
|
|
1252
|
+
# Return True to indicate the job was successfully resumed
|
|
1291
1253
|
return True
|
|
1292
1254
|
|
|
1293
1255
|
except Exception:
|
|
@@ -1339,6 +1301,8 @@ class Scheduler(ISchedule):
|
|
|
1339
1301
|
|
|
1340
1302
|
# Log the successful removal of the job
|
|
1341
1303
|
self.__logger.info(f"Job '{signature}' has been removed from the scheduler.")
|
|
1304
|
+
|
|
1305
|
+
# Return True to indicate the job was successfully removed
|
|
1342
1306
|
return True
|
|
1343
1307
|
|
|
1344
1308
|
except Exception:
|
orionis/metadata/framework.py
CHANGED
|
@@ -8,7 +8,7 @@ orionis/console/args/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
8
8
|
orionis/console/args/enums/actions.py,sha256=S3T-vWS6DJSGtANrq3od3-90iYAjPvJwaOZ2V02y34c,1222
|
|
9
9
|
orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
orionis/console/base/command.py,sha256=OM4xqVgpv_1RZVyVG8BzOHl1sP9FT5mPUwZjMil8IRg,6637
|
|
11
|
-
orionis/console/base/scheduler.py,sha256=
|
|
11
|
+
orionis/console/base/scheduler.py,sha256=w86p-4KjfMqMcGlQBsmiBASpzv33M-PWLbgYza7Um9g,8030
|
|
12
12
|
orionis/console/base/scheduler_event_listener.py,sha256=5qWPmf6jmiRwUz6U1ZvpQCG5eovOpeCl0KAb8kKDkfU,3905
|
|
13
13
|
orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
orionis/console/commands/cache.py,sha256=8DsYoRzSBLn0P9qkGVItRbo0R6snWBDBg0_Xa7tmVhs,2322
|
|
@@ -26,7 +26,7 @@ orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01
|
|
|
26
26
|
orionis/console/contracts/reactor.py,sha256=Xeq7Zrw6WE5MV_XOQfiQEchAFbb6-0TjLpjWOxYW--g,4554
|
|
27
27
|
orionis/console/contracts/schedule.py,sha256=17cfPYtLo-jqF8FxYOhh4epJZnxw5mMPuLGaWoUwxL4,12171
|
|
28
28
|
orionis/console/contracts/schedule_event_listener.py,sha256=G-Ye9YIzfeXFcJD1jqNOy7Cj_-VQGq0ynXZCTPTp7Mc,11550
|
|
29
|
-
orionis/console/contracts/scheduler.py,sha256=
|
|
29
|
+
orionis/console/contracts/scheduler.py,sha256=OW-a_YDDNPrenYT9z8Tv71VjyZ1aSzqzqhTBhTCZhGM,7698
|
|
30
30
|
orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
orionis/console/core/reactor.py,sha256=JlxNiqmyzAqiS21hxOMD5ELiDNPzmGHYDNrdlaMvYuI,30409
|
|
32
32
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -81,7 +81,7 @@ orionis/console/request/cli_request.py,sha256=7-sgYmNUCipuHLVAwWLJiHv0cJCDmsM1Lu
|
|
|
81
81
|
orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
82
|
orionis/console/tasks/event.py,sha256=l4J-HEPaj1mxB_PYQMgG9dRHUe01wUag8fKLLnR2N2M,164395
|
|
83
83
|
orionis/console/tasks/listener.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
|
-
orionis/console/tasks/schedule.py,sha256=
|
|
84
|
+
orionis/console/tasks/schedule.py,sha256=kKRqjy5IVRnVtFH_M1j_CXiRRP5GWlAtm6OFkMVuq5w,56567
|
|
85
85
|
orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
orionis/container/container.py,sha256=aF_b6lTUpG4YCo9yFJEzsntTdIzgMMXFW5LyWqAJVBQ,87987
|
|
87
87
|
orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -239,7 +239,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
|
|
|
239
239
|
orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
|
|
240
240
|
orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
|
|
241
241
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
242
|
-
orionis/metadata/framework.py,sha256=
|
|
242
|
+
orionis/metadata/framework.py,sha256=wug5g4rr99G557BnwMHazwC0CR8MPOjrfZhcyhWmfWo,4109
|
|
243
243
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
244
244
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
245
245
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -415,7 +415,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
|
|
|
415
415
|
orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
|
|
416
416
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
417
417
|
orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
|
|
418
|
-
orionis-0.
|
|
418
|
+
orionis-0.518.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
419
419
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
420
420
|
tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
421
421
|
tests/container/context/test_manager.py,sha256=wOwXpl9rHNfTTexa9GBKYMwK0_-KSQPbI-AEyGNkmAE,1356
|
|
@@ -561,8 +561,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
561
561
|
tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
|
|
562
562
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
563
563
|
tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
|
|
564
|
-
orionis-0.
|
|
565
|
-
orionis-0.
|
|
566
|
-
orionis-0.
|
|
567
|
-
orionis-0.
|
|
568
|
-
orionis-0.
|
|
564
|
+
orionis-0.518.0.dist-info/METADATA,sha256=57ipFsdsX4YY8wMWB_LqFKG5Y6eBUj8MkjFdM4WERuo,4801
|
|
565
|
+
orionis-0.518.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
566
|
+
orionis-0.518.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
567
|
+
orionis-0.518.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
568
|
+
orionis-0.518.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|