From 67fb25096363a179150fa8adf6e0e97baacc9ec5 Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Mon, 21 Jan 2019 22:14:13 +0100 Subject: [PATCH] Do not block in mailer --- punkow/service/mailer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/punkow/service/mailer.py b/punkow/service/mailer.py index 07dd4a7..9d4f99e 100644 --- a/punkow/service/mailer.py +++ b/punkow/service/mailer.py @@ -76,7 +76,7 @@ class Mailer(object): async def send_success_email(self, email, booking: scraper.BookingResult): tpl = self._tpl.get_template("success.txt") - text = tpl.render(meta=booking.metadata, change_url=scraper.MANAGE_URL, + text = tpl.render(meta=booking.metadata, change_url=scraper.BASE_URL + scraper.MANAGE_URL, process_id=booking.process_id, auth_code=booking.auth_key) await self._send_email(email, "Your appointment was booked", text) @@ -109,7 +109,7 @@ class AsyncMailQueue(object): async def __aexit__(self, exc_type, exc_val, exc_tb): if len(self._queue) != 0: await self._loop.run_in_executor(None, functools.partial( - concurrent.futures.wait(self._queue))) + concurrent.futures.wait, self._queue)) def _append_task(self, coro): self._queue.append(asyncio.run_coroutine_threadsafe(coro, self._loop))