diff options
author | 2022-01-09 17:17:03 -0800 | |
---|---|---|
committer | 2022-01-09 17:17:03 -0800 | |
commit | bdf43f4ced428ce092ac2e24cdcf7d47c9995ff0 (patch) | |
tree | 794975471260829e198521ed1fab7b94e851ffca | |
parent | Converters: use datetime.timezone instead of dateutil.tz (diff) |
Scheduling: add Arrow to schedule_at's type annotations
-rw-r--r-- | bot/utils/scheduling.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py index 7b4c8e2de..23acacf74 100644 --- a/bot/utils/scheduling.py +++ b/bot/utils/scheduling.py @@ -5,6 +5,8 @@ import typing as t from datetime import datetime from functools import partial +from arrow import Arrow + from bot.log import get_logger @@ -58,7 +60,7 @@ class Scheduler: self._scheduled_tasks[task_id] = task self._log.debug(f"Scheduled task #{task_id} {id(task)}.") - def schedule_at(self, time: datetime, task_id: t.Hashable, coroutine: t.Coroutine) -> None: + def schedule_at(self, time: t.Union[datetime, Arrow], task_id: t.Hashable, coroutine: t.Coroutine) -> None: """ Schedule `coroutine` to be executed at the given `time`. |