From 6e7d529abffcb0de0b961c2fc8e1b8ac4d2f524d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 26 Mar 2022 20:42:26 +0100 Subject: [PATCH] i3-companion: avoid invoking bluetooth_status() without creating a task --- bin/i3-companion | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/i3-companion b/bin/i3-companion index a82003b..d1b5d6b 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -860,7 +860,8 @@ async def bluetooth_status(i3, event, *args): output[-1] = f"{output[-1]},{icon}" # Schedule a refresh in 5 minutes bluetooth_status.scheduled = loop.call_later( - 600, asyncio.create_task, bluetooth_status(i3, StartEvent) + 600, + lambda: asyncio.create_task(bluetooth_status(i3, StartEvent)), ) except Exception as exc: logger.info("cannot get battery status: %s", exc)