aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/utils/scheduling.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py
index 4a003d4fe..625b726d2 100644
--- a/bot/utils/scheduling.py
+++ b/bot/utils/scheduling.py
@@ -18,15 +18,15 @@ class Scheduler:
"""Return True if a task with the given `task_id` is currently scheduled."""
return task_id in self._scheduled_tasks
- def schedule(self, task_id: t.Hashable, task: t.Awaitable) -> None:
- """Schedule the execution of a task."""
+ def schedule(self, task_id: t.Hashable, coroutine: t.Coroutine) -> None:
+ """Schedule the execution of a coroutine."""
self._log.trace(f"Scheduling task #{task_id}...")
if task_id in self._scheduled_tasks:
self._log.debug(f"Did not schedule task #{task_id}; task was already scheduled.")
return
- task = asyncio.create_task(task, name=f"{self.name}_{task_id}")
+ task = asyncio.create_task(coroutine, name=f"{self.name}_{task_id}")
task.add_done_callback(partial(self._task_done_callback, task_id))
self._scheduled_tasks[task_id] = task