From 1cef25ffc479653cfc73e536029128165f9ce8a7 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 17 Nov 2018 18:01:53 -0300 Subject: [PATCH] user.billing_job: fix unwanted await due to spawn() being non-coro --- litecord/blueprints/user/billing_job.py | 2 +- litecord/jobs.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/litecord/blueprints/user/billing_job.py b/litecord/blueprints/user/billing_job.py index bff05a9..79ffe48 100644 --- a/litecord/blueprints/user/billing_job.py +++ b/litecord/blueprints/user/billing_job.py @@ -26,7 +26,7 @@ THRESHOLDS = { async def _resched(app): log.debug('waiting 2 minutes for job.') await sleep(120) - await app.sched.spawn(payment_job(app)) + app.sched.spawn(payment_job(app)) async def _process_user_payments(app, user_id: int): diff --git a/litecord/jobs.py b/litecord/jobs.py index 083d031..c6afec8 100644 --- a/litecord/jobs.py +++ b/litecord/jobs.py @@ -20,6 +20,7 @@ class JobManager: task = self.loop.create_task( self._wrapper(coro) ) + self.jobs.append(task) def close(self):