|
@@ -161,7 +161,7 @@ class MailFetcher(object):
|
161
|
161
|
folder: str,
|
162
|
162
|
use_idle: bool,
|
163
|
163
|
connection_max_lifetime: int,
|
164
|
|
- delay: int,
|
|
164
|
+ heartbeat: int,
|
165
|
165
|
endpoint: str,
|
166
|
166
|
token: str,
|
167
|
167
|
use_html_parsing: bool,
|
|
@@ -179,7 +179,7 @@ class MailFetcher(object):
|
179
|
179
|
:param use_ssl: use imap over ssl connection
|
180
|
180
|
:param folder: mail folder where new mail are fetched
|
181
|
181
|
:param use_idle: use IMAP IDLE(server notification) when available
|
182
|
|
- :param delay: seconds to wait before fetching new mail again
|
|
182
|
+ :param heartbeat: seconds to wait before fetching new mail again
|
183
|
183
|
:param connection_max_lifetime: maximum duration allowed for a connection.
|
184
|
184
|
connection is automatically renew when his lifetime excess this value
|
185
|
185
|
:param endpoint: tracim http endpoint where decoded mail are send.
|
|
@@ -193,7 +193,7 @@ class MailFetcher(object):
|
193
|
193
|
self.password = password
|
194
|
194
|
self.use_ssl = use_ssl
|
195
|
195
|
self.folder = folder
|
196
|
|
- self.delay = delay
|
|
196
|
+ self.heartbeat = heartbeat
|
197
|
197
|
self.use_idle = use_idle
|
198
|
198
|
self.connection_max_lifetime = connection_max_lifetime
|
199
|
199
|
self.endpoint = endpoint
|
|
@@ -217,8 +217,8 @@ class MailFetcher(object):
|
217
|
217
|
except Exception as e:
|
218
|
218
|
log = 'Fail to connect to IMAP {}'
|
219
|
219
|
logger.error(self, log.format(e.__str__()))
|
220
|
|
- logger.debug(self, 'sleep for {}'.format(self.delay))
|
221
|
|
- time.sleep(self.delay)
|
|
220
|
+ logger.debug(self, 'sleep for {}'.format(self.heartbeat))
|
|
221
|
+ time.sleep(self.heartbeat)
|
222
|
222
|
continue
|
223
|
223
|
|
224
|
224
|
# fetching
|
|
@@ -250,8 +250,8 @@ class MailFetcher(object):
|
250
|
250
|
'support it, use polling instead.'
|
251
|
251
|
logger.warning(self, log)
|
252
|
252
|
# normal polling mode : sleep a define duration
|
253
|
|
- logger.debug(self, 'sleep for {}'.format(self.delay))
|
254
|
|
- time.sleep(self.delay)
|
|
253
|
+ logger.debug(self, 'sleep for {}'.format(self.heartbeat))
|
|
254
|
+ time.sleep(self.heartbeat)
|
255
|
255
|
|
256
|
256
|
logger.debug(self,"Lifetime limit excess, Renew connection")
|
257
|
257
|
except filelock.Timeout as e:
|