diff options
author | drebs <drebs@leap.se> | 2015-08-05 14:36:34 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2015-08-18 12:01:03 -0300 |
commit | b7ec1936ec9e8bd2123b489ab25c547e43cd515f (patch) | |
tree | a4b4681e49e6dcca8b41e6486e8aaecf7131645a /scripts/profiling | |
parent | e5e5a6a8e6ca209b0abf3a95521c9e6d5b329565 (diff) |
[bug] always release lock on spam script
Diffstat (limited to 'scripts/profiling')
-rwxr-xr-x | scripts/profiling/spam.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/profiling/spam.py b/scripts/profiling/spam.py index 76a5ed97..119d8496 100755 --- a/scripts/profiling/spam.py +++ b/scripts/profiling/spam.py @@ -79,10 +79,14 @@ class EmailSenderThread(threading.Thread): def run(self): logger.debug("running thread...") - _send_email( - self._server, self._port, self._subject, self._to_addr, - self._from_addr, self._body_text) - self._finished_fun() + try: + _send_email( + self._server, self._port, self._subject, self._to_addr, + self._from_addr, self._body_text) + except Exception as e: + logger.error(e) + finally: + self._finished_fun() def _launch_email_thread(server, port, subject, to_addr, from_addr, body_text, |