File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,6 @@ async def _run(self) -> None:
143143 self ._dispatches .pop (dispatch .id )
144144 await self ._update_dispatch_schedule_and_notify (None , dispatch )
145145
146- dispatch ._set_deleted () # pylint: disable=protected-access
147146 await self ._lifecycle_updates_sender .send (
148147 Deleted (dispatch = dispatch )
149148 )
@@ -238,16 +237,18 @@ async def _update_dispatch_schedule_and_notify(
238237 if not dispatch and old_dispatch :
239238 self ._remove_scheduled (old_dispatch )
240239
240+ was_running = old_dispatch .started
241+ old_dispatch ._set_deleted () # pylint: disable=protected-access)
242+
241243 # If the dispatch was running, we need to notify
242- if old_dispatch . started :
244+ if was_running :
243245 await self ._send_running_state_change (old_dispatch )
244246
245247 # A new dispatch was created
246248 elif dispatch and not old_dispatch :
247249 assert not self ._remove_scheduled (
248250 dispatch
249251 ), "New dispatch already scheduled?!"
250-
251252 # If its currently running, send notification right away
252253 if dispatch .started :
253254 await self ._send_running_state_change (dispatch )
You can’t perform that action at this time.
0 commit comments