File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ def __init__(
71
71
72
72
async def _run (self ) -> None :
73
73
"""Run the actor."""
74
+ _logger .info ("Starting dispatch actor for microgrid %s" , self ._microgrid_id )
75
+
74
76
# Initial fetch
75
77
await self ._fetch ()
76
78
@@ -272,11 +274,16 @@ def _schedule_start(self, dispatch: Dispatch) -> None:
272
274
return
273
275
274
276
# Schedule the next run
275
- if next_run := dispatch .next_run :
276
- heappush (self ._scheduled_events , (next_run , dispatch ))
277
- _logger .debug ("Scheduled dispatch %s to start at %s" , dispatch .id , next_run )
278
- else :
279
- _logger .debug ("Dispatch %s has no next run" , dispatch .id )
277
+ try :
278
+ if next_run := dispatch .next_run :
279
+ heappush (self ._scheduled_events , (next_run , dispatch ))
280
+ _logger .debug (
281
+ "Scheduled dispatch %s to start at %s" , dispatch .id , next_run
282
+ )
283
+ else :
284
+ _logger .debug ("Dispatch %s has no next run" , dispatch .id )
285
+ except ValueError as error :
286
+ _logger .error ("Error scheduling dispatch %s: %s" , dispatch .id , error )
280
287
281
288
def _schedule_stop (self , dispatch : Dispatch ) -> None :
282
289
"""Schedule a dispatch to stop.
You can’t perform that action at this time.
0 commit comments