X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fvim_admin.py;h=e34cce4a5216e18a72b11b3faabef5977b1095cd;hb=HEAD;hp=21e62817321b68f6ebb1b6859199b8e360f9c1b0;hpb=a264b7a460b28d7454fc95fe659da46f55b0c155;p=osm%2FRO.git diff --git a/NG-RO/osm_ng_ro/vim_admin.py b/NG-RO/osm_ng_ro/vim_admin.py index 21e62817..e34cce4a 100644 --- a/NG-RO/osm_ng_ro/vim_admin.py +++ b/NG-RO/osm_ng_ro/vim_admin.py @@ -380,7 +380,7 @@ class VimAdminThread(threading.Thread): self.logger.info("Starting") while not self.to_terminate: try: - asyncio.run_coroutine_threadsafe(self.main_task(), self.loop) + asyncio.run(self.main_task()) except Exception as e: if not self.to_terminate: self.logger.exception( @@ -458,12 +458,12 @@ class VimAdminThread(threading.Thread): self.lock_renew.to_terminate = True if self.aiomain_task_kafka: - self.aiomain_task_kafka.cancel() + self.loop.call_soon_threadsafe(self.aiomain_task_kafka.cancel()) if self.aiomain_task_vim: - self.aiomain_task_vim.cancel() + self.loop.call_soon_threadsafe(self.aiomain_task_vim.cancel()) if self.aiomain_task_renew_lock: - self.aiomain_task_renew_lock.cancel() + self.loop.call_soon_threadsafe(self.aiomain_task_renew_lock.cancel()) self.lock_renew.stop()