api: fix ccujack cron task not being properly stopped
All checks were successful
Build Container / Build Container (push) Successful in 1m36s

This commit is contained in:
lilly 2026-05-19 15:17:41 +02:00
commit 41fd939d30
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
2 changed files with 2 additions and 1 deletions

View file

@ -29,7 +29,6 @@ async def lifespan(app: FastAPI):
scope=app_cfg.openid_scope,
)
# TODO: regularly re-query CCUJACK to discover new locks
app.extra["ccujack"] = CCUJackClient(
base_uri=app_cfg.ccujack_url,
auth=BasicAuth(app_cfg.ccujack_user, app_cfg.ccujack_password),

View file

@ -104,6 +104,8 @@ class CCUJackClient:
await asyncio.gather(self.mqtt.disconnect(), self.http.close())
self.task_process_messages.cancel()
self.task_process_messages = None
self.task.cron.cancel()
self.task.cron = None
async def find_locks(self):
logger.debug("Inspecting lock devices present in CCUJack")