summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/service
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-08-06 01:37:10 +0200
committerKali Kaneko <kali@leap.se>2013-08-06 01:50:49 +0200
commit2c2f3a291d33591190af4cefbcd2225c11e86712 (patch)
tree9610f3d88591834c7b75180409aa1fa00f4947df /src/leap/mail/imap/service
parenta16ca973433dc44cb71df14ed1e999b35f20ce03 (diff)
refactor recurring fetch
Diffstat (limited to 'src/leap/mail/imap/service')
-rw-r--r--src/leap/mail/imap/service/imap.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/leap/mail/imap/service/imap.py b/src/leap/mail/imap/service/imap.py
index 6a8d37f..9e331b6 100644
--- a/src/leap/mail/imap/service/imap.py
+++ b/src/leap/mail/imap/service/imap.py
@@ -20,9 +20,7 @@ Imap service initialization
import logging
logger = logging.getLogger(__name__)
-#from twisted.application import internet, service
from twisted.internet.protocol import ServerFactory
-from twisted.internet.task import LoopingCall
from twisted.mail import imap4
from twisted.python import log
@@ -36,8 +34,8 @@ from leap.soledad import Soledad
IMAP_PORT = 9930
# The default port in which imap service will run
-#INCOMING_CHECK_PERIOD = 10
-INCOMING_CHECK_PERIOD = 5
+# INCOMING_CHECK_PERIOD = 5
+INCOMING_CHECK_PERIOD = 60
# The period between succesive checks of the incoming mail
# queue (in seconds)
@@ -148,12 +146,10 @@ def run_service(*args, **kwargs):
fetcher = LeapIncomingMail(
keymanager,
soledad,
- factory.theAccount)
+ factory.theAccount,
+ check_period)
- lc = LoopingCall(fetcher.fetch)
- lc.start(check_period)
+ fetcher.start_loop()
logger.debug("IMAP4 Server is RUNNING in port %s" % (port,))
-
- # XXX maybe return both fetcher and lc??
- return lc
+ return fetcher