diff options
author | Kali Kaneko <kali@leap.se> | 2013-12-05 09:48:59 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-12-05 09:48:59 -0400 |
commit | 87ef6bd11a8b8ecf153c996fc560272d279ba6f8 (patch) | |
tree | b877cadec9540f589b8027851c09d2289be28d9c /src | |
parent | d2a6fd962a608e72a1367eada8fd791183da4cc1 (diff) | |
parent | 8a4f63baadf8f28209d5fab95383634e8c813948 (diff) |
Merge remote-tracking branch 'chiiph/bug/fix_deadlock' into develop
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/mx/mail_receiver.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index c06754e..c90dda9 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -266,20 +266,29 @@ class MailReceiver(Service): defer.returnValue(None) self._processing_skipped = True - log.msg("Starting processing skipped mail...") - log.msg("-"*50) - - for directory, recursive in self._directories: - for root, dirs, files in os.walk(directory): - for fname in files: - fullpath = os.path.join(root, fname) - fpath = filepath.FilePath(fullpath) - yield self._step_process_mail_backend(fpath) - - if not recursive: - break + try: + log.msg("Starting processing skipped mail...") + log.msg("-"*50) + + for directory, recursive in self._directories: + for root, dirs, files in os.walk(directory): + for fname in files: + try: + fullpath = os.path.join(root, fname) + fpath = filepath.FilePath(fullpath) + yield self._step_process_mail_backend(fpath) + except Exception as e: + log.msg("Error processing skipped mail: %r" % \ + (fullpath,)) + log.err() + if not recursive: + break + except Exception as e: + log.msg("Error processing skipped mail") + log.err() + finally: + self._processing_skipped = False - self._processing_skipped = False log.msg("+"*50) log.msg("Done processing skipped mail") |