Browse Source

Notify if IDLE is enable but not available

Guénaël Muller 7 years ago
parent
commit
58da79b472
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tracim/tracim/lib/email_fetcher.py

+ 4 - 0
tracim/tracim/lib/email_fetcher.py View File

245
                         )
245
                         )
246
                         imapc.idle_done()
246
                         imapc.idle_done()
247
                     else:
247
                     else:
248
+                        if self.use_idle and not imapc.has_capability('IDLE'):
249
+                            log = 'IDLE mode activated but server do not' \
250
+                                  'support it, use polling instead.'
251
+                            logger.warning(self, log)
248
                         # normal polling mode : sleep a define duration
252
                         # normal polling mode : sleep a define duration
249
                         logger.debug(self, 'sleep for {}'.format(self.delay))
253
                         logger.debug(self, 'sleep for {}'.format(self.delay))
250
                         time.sleep(self.delay)
254
                         time.sleep(self.delay)