From 8d19e79b9e946209973a2efb87843a4ea3f47b7d Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 21 Aug 2013 18:55:50 +0200 Subject: Make a sensible default for incoming mail fetch period. Setting it to 5 min. --- changes/feature_3409-imap-fetch-period | 2 ++ src/leap/mail/imap/fetch.py | 3 +-- src/leap/mail/imap/service/imap.py | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 changes/feature_3409-imap-fetch-period diff --git a/changes/feature_3409-imap-fetch-period b/changes/feature_3409-imap-fetch-period new file mode 100644 index 0000000..a6e2dd2 --- /dev/null +++ b/changes/feature_3409-imap-fetch-period @@ -0,0 +1,2 @@ + o Make default imap fetch period 5 minutes. Client can config it + via environment variable for debug. Closes: #3409 diff --git a/src/leap/mail/imap/fetch.py b/src/leap/mail/imap/fetch.py index 3b15c6a..592e4e3 100644 --- a/src/leap/mail/imap/fetch.py +++ b/src/leap/mail/imap/fetch.py @@ -104,7 +104,6 @@ class LeapIncomingMail(object): Calls a deferred that will execute the fetch callback in a separate thread """ - logger.debug('fetching mail...') d = deferToThread(self._sync_soledad) d.addCallbacks(self._process_doclist, self._sync_soledad_err) return d @@ -125,7 +124,6 @@ class LeapIncomingMail(object): def _sync_soledad(self): log.msg('syncing soledad...') - logger.debug('in soledad sync') try: self._soledad.sync() @@ -212,6 +210,7 @@ class LeapIncomingMail(object): return False logger.debug('got incoming message: %s' % (rawmsg,)) + # XXX factor out gpg bits. try: pgp_beg = "-----BEGIN PGP MESSAGE-----" pgp_end = "-----END PGP MESSAGE-----" diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py index 6b2a61d..94c2c64 100644 --- a/src/leap/mail/imap/service/imap.py +++ b/src/leap/mail/imap/service/imap.py @@ -34,14 +34,12 @@ from leap.mail.imap.server import SoledadBackedAccount from leap.mail.imap.fetch import LeapIncomingMail from leap.soledad import Soledad -IMAP_PORT = 1984 # The default port in which imap service will run +IMAP_PORT = 1984 -# TODO: Make this configurable -INCOMING_CHECK_PERIOD = 5 -#INCOMING_CHECK_PERIOD = 60 # The period between succesive checks of the incoming mail # queue (in seconds) +INCOMING_CHECK_PERIOD = 300 from leap.common.events.events_pb2 import IMAP_SERVICE_STARTED from leap.common.events.events_pb2 import IMAP_SERVICE_FAILED_TO_START -- cgit v1.2.3