summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-12-05 09:48:59 -0400
committerKali Kaneko <kali@leap.se>2013-12-05 09:48:59 -0400
commit87ef6bd11a8b8ecf153c996fc560272d279ba6f8 (patch)
treeb877cadec9540f589b8027851c09d2289be28d9c /src
parentd2a6fd962a608e72a1367eada8fd791183da4cc1 (diff)
parent8a4f63baadf8f28209d5fab95383634e8c813948 (diff)
Merge remote-tracking branch 'chiiph/bug/fix_deadlock' into develop
Diffstat (limited to 'src')
-rw-r--r--src/leap/mx/mail_receiver.py35
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")