mirror of https://github.com/janLo/punkow
Don't crash if mail delivery failed
This commit is contained in:
parent
3e6b6f65ae
commit
1415b8e37f
|
|
@ -108,8 +108,11 @@ class AsyncMailQueue(object):
|
||||||
|
|
||||||
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||||
if len(self._queue) != 0:
|
if len(self._queue) != 0:
|
||||||
|
try:
|
||||||
await self._loop.run_in_executor(None, functools.partial(
|
await self._loop.run_in_executor(None, functools.partial(
|
||||||
concurrent.futures.wait, self._queue))
|
concurrent.futures.wait, self._queue))
|
||||||
|
except:
|
||||||
|
logger.exception("Exception in waiting for mail sending")
|
||||||
|
|
||||||
def _append_task(self, coro):
|
def _append_task(self, coro):
|
||||||
self._queue.append(asyncio.run_coroutine_threadsafe(coro, self._loop))
|
self._queue.append(asyncio.run_coroutine_threadsafe(coro, self._loop))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue