Skip to content

Commit

Permalink
service, scheduler: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dxstiny committed Sep 25, 2024
1 parent 4f4daff commit 77f9637
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/common/aioschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
__email__ = "[email protected]"

from typing import Callable, Awaitable
from datetime import datetime, time
from datetime import datetime, time, timedelta
import asyncio
import logging

ONE_DAY_IN_SECONDS = 24 * 3600

Expand Down Expand Up @@ -73,6 +74,12 @@ async def _implement() -> None:
next_weekday_to_run - next_target
)

logging.getLogger().debug(
"Next run at %s in %d seconds",
datetime.now() + timedelta(seconds=time_until),
time_until
)

await asyncio.sleep(time_until)
await func()

Expand Down

0 comments on commit 77f9637

Please sign in to comment.