Commit cd8c4b43 authored by Christopher Bremner's avatar Christopher Bremner

Don't cancel missing subscription task

parent bd9d8fdb
......@@ -51,10 +51,13 @@ class InternalSubscription:
self._task = self.loop.create_task(self._subscription_loop())
async def stop(self):
self.logger.info("stopping internal subscription %s", self.data.SubscriptionId)
self._task.cancel()
await self._task
self._task = None
if self._task:
self.logger.info("stopping internal subscription %s", self.data.SubscriptionId)
self._task.cancel()
await self._task
self._task = None
else:
self.logger.debug(f"internal subscription has no task to stop")
self.monitored_item_srv.delete_all_monitored_items()
def _trigger_publish(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment