From 21f278b1aae85dd33f84cf44ffa1ea0ede13bc90 Mon Sep 17 00:00:00 2001 From: "A.Shpak" Date: Tue, 2 Apr 2024 19:43:45 +0300 Subject: [PATCH] - --- chatushka/_bot.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/chatushka/_bot.py b/chatushka/_bot.py index 154e11b..ff596e3 100644 --- a/chatushka/_bot.py +++ b/chatushka/_bot.py @@ -3,7 +3,6 @@ from collections.abc import AsyncGenerator, MutableMapping, Sequence from contextlib import AbstractAsyncContextManager, asynccontextmanager from datetime import timezone, tzinfo -from functools import partial from traceback import print_exception import aiocron # type: ignore @@ -59,6 +58,7 @@ async def _call_scheduled( self, func, ): + logger.info(f"{self} ::: scheduled call of {func.__name__}") async with self._make_api_client() as client: await func( api=client, @@ -72,12 +72,7 @@ def schedule( def _wrapper( func, ): - job = aiocron.Cron( - cron, - func=partial(self._call_scheduled, func=func), - start=False, - tz=tz, - ) + job = aiocron.Cron(cron, self._call_scheduled, start=False, tz=tz, args=func) logger.info(f"{self} + {job}") self._schedulers.append(job)