Last active
August 29, 2015 14:02
-
-
Save mart-e/82132b01c91f3238052c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py | |
index 515881e..ec047fb 100644 | |
--- a/addons/fetchmail/fetchmail.py | |
+++ b/addons/fetchmail/fetchmail.py | |
@@ -180,6 +180,7 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p | |
def fetch_mail(self, cr, uid, ids, context=None): | |
"""WARNING: meant for cron usage only - will commit() after each email!""" | |
+ _logger.warning("FETCHMAIL %s" % id(cr)) | |
if context is None: | |
context = {} | |
context['fetchmail_cron_running'] = True | |
@@ -197,6 +198,11 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p | |
imap_server.select() | |
result, data = imap_server.search(None, '(UNSEEN)') | |
for num in data[0].split(): | |
+ _logger.warning("COMMIT %s" % num) | |
+ cr.commit() | |
+ time.sleep(100) | |
+ _logger.warning("END SLEEP %s" % num) | |
+ | |
res_id = None | |
result, data = imap_server.fetch(num, '(RFC822)') | |
imap_server.store(num, '-FLAGS', '\\Seen') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment