api: fix ccujack cron task not being properly stopped
All checks were successful
Build Container / Build Container (push) Successful in 1m36s
All checks were successful
Build Container / Build Container (push) Successful in 1m36s
This commit is contained in:
parent
2349e58924
commit
41fd939d30
2 changed files with 2 additions and 1 deletions
|
|
@ -29,7 +29,6 @@ async def lifespan(app: FastAPI):
|
||||||
scope=app_cfg.openid_scope,
|
scope=app_cfg.openid_scope,
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: regularly re-query CCUJACK to discover new locks
|
|
||||||
app.extra["ccujack"] = CCUJackClient(
|
app.extra["ccujack"] = CCUJackClient(
|
||||||
base_uri=app_cfg.ccujack_url,
|
base_uri=app_cfg.ccujack_url,
|
||||||
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password),
|
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password),
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,8 @@ class CCUJackClient:
|
||||||
await asyncio.gather(self.mqtt.disconnect(), self.http.close())
|
await asyncio.gather(self.mqtt.disconnect(), self.http.close())
|
||||||
self.task_process_messages.cancel()
|
self.task_process_messages.cancel()
|
||||||
self.task_process_messages = None
|
self.task_process_messages = None
|
||||||
|
self.task.cron.cancel()
|
||||||
|
self.task.cron = None
|
||||||
|
|
||||||
async def find_locks(self):
|
async def find_locks(self):
|
||||||
logger.debug("Inspecting lock devices present in CCUJack")
|
logger.debug("Inspecting lock devices present in CCUJack")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue