From 4ef24351aa8bb83aa0cd92f4f99cc35f9b713b6a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 20 Aug 2024 17:05:32 -0400 Subject: [PATCH] Do not await synchronous functions --- confluent_server/confluent/log.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/log.py b/confluent_server/confluent/log.py index 7e34553a..b159853d 100644 --- a/confluent_server/confluent/log.py +++ b/confluent_server/confluent/log.py @@ -68,6 +68,7 @@ import collections import confluent.config.configmanager import confluent.config.conf as conf import confluent.exceptions as exc +import inspect import glob import json import os @@ -117,7 +118,9 @@ _loggers = {} async def _sleep_and_run(sleeptime, func, args): await asyncio.sleep(sleeptime) - await func(*args) + awt = func(*args) + if inspect.isawaitable(awt): + await awt def spawn_after(sleeptime, func, *args):