From 404720c54db72832345930a6f516cf7184d88119 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 17 Nov 2018 00:03:18 -0300 Subject: [PATCH] user.billing_job: handle CancelledError --- litecord/blueprints/user/billing_job.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litecord/blueprints/user/billing_job.py b/litecord/blueprints/user/billing_job.py index d33b181..bff05a9 100644 --- a/litecord/blueprints/user/billing_job.py +++ b/litecord/blueprints/user/billing_job.py @@ -2,7 +2,7 @@ this file only serves the periodic payment job code. """ import datetime -from asyncio import sleep +from asyncio import sleep, CancelledError from logbook import Logger from litecord.blueprints.user.billing import ( @@ -98,4 +98,7 @@ async def payment_job(app): log.exception('error while processing user payments') log.debug('rescheduling..') - await _resched(app) + try: + await _resched(app) + except CancelledError: + log.info('cancelled while waiting for resched')