aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/scheduling.py
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-15 20:16:30 -0800
committerGravatar MarkKoz <[email protected]>2020-02-15 20:16:30 -0800
commit0d05be37564b1ec8babd688fb348c2c13eeb9fa2 (patch)
tree8b20a02909ddef16da0429de37934dd2b1178ec2 /bot/utils/scheduling.py
parentScheduler: correct schedule_task's docstring (diff)
Scheduler: remove loop parameter from schedule_task
asyncio.create_task() exists and will already use the running loop in the current thread. Because there is no intention of using a different loop in a different thread anywhere in the program for the foreseeable future, the loop parameter is redundant.
Diffstat (limited to '')
-rw-r--r--bot/utils/scheduling.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py
index adf10d683..a16900066 100644
--- a/bot/utils/scheduling.py
+++ b/bot/utils/scheduling.py
@@ -29,7 +29,7 @@ class Scheduler(metaclass=CogABCMeta):
then make a site API request to delete the reminder from the database.
"""
- def schedule_task(self, loop: asyncio.AbstractEventLoop, task_id: str, task_data: dict) -> None:
+ def schedule_task(self, task_id: str, task_data: dict) -> None:
"""
Schedules a task.
@@ -41,7 +41,7 @@ class Scheduler(metaclass=CogABCMeta):
)
return
- task = loop.create_task(self._scheduled_task(task_data))
+ task = asyncio.create_task(self._scheduled_task(task_data))
task.add_done_callback(_suppress_cancelled_error)
self.scheduled_tasks[task_id] = task