Commit 5590a3e9 authored by Colomban Wendling's avatar Colomban Wendling

Don't report a task done when reaching timeout

This fixes crashing the mail thread when there the queue is empty after
config.emails.smtp_keepalive_timeout seconds.
parent 3124a204
...@@ -55,7 +55,8 @@ class ThreadedSMTP(object): ...@@ -55,7 +55,8 @@ class ThreadedSMTP(object):
except Exception as e: except Exception as e:
print("Couldn't send email: %s" % str(e), file=stderr) print("Couldn't send email: %s" % str(e), file=stderr)
finally: finally:
self._queue.task_done() if server: # server is None on exception queue.Empty
self.__server_quit(server) self.__server_quit(server)
def sendmail(self, *args, **kwargs): def sendmail(self, *args, **kwargs):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment