diff options
| author | 2020-06-20 13:20:24 -0700 | |
|---|---|---|
| committer | 2020-06-20 13:20:24 -0700 | |
| commit | 19e41aae30e19374054d9ed37f36faa2104f751c (patch) | |
| tree | 5f0b37ce981f28c7f07b4b29d90b5282f456e340 | |
| parent | Scheduler: remove ignore_missing param (diff) | |
Scheduler: drop _task suffix from method names
It's redundant. After all, this scheduler cannot schedule anything else.
| -rw-r--r-- | bot/utils/scheduling.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py index d9b48034b..4a003d4fe 100644 --- a/bot/utils/scheduling.py +++ b/bot/utils/scheduling.py @@ -18,7 +18,7 @@ class Scheduler: """Return True if a task with the given `task_id` is currently scheduled.""" return task_id in self._scheduled_tasks - def schedule_task(self, task_id: t.Hashable, task: t.Awaitable) -> None: + def schedule(self, task_id: t.Hashable, task: t.Awaitable) -> None: """Schedule the execution of a task.""" self._log.trace(f"Scheduling task #{task_id}...") @@ -32,7 +32,7 @@ class Scheduler: self._scheduled_tasks[task_id] = task self._log.debug(f"Scheduled task #{task_id} {id(task)}.") - def cancel_task(self, task_id: t.Hashable) -> None: + def cancel(self, task_id: t.Hashable) -> None: """Unschedule the task identified by `task_id`. Log a warning if the task doesn't exist.""" self._log.trace(f"Cancelling task #{task_id}...") @@ -51,7 +51,7 @@ class Scheduler: self._log.debug("Unscheduling all tasks") for task_id in self._scheduled_tasks.copy(): - self.cancel_task(task_id) + self.cancel(task_id) def _task_done_callback(self, task_id: t.Hashable, done_task: asyncio.Task) -> None: """ |