diff options
Diffstat (limited to 'Mailman/Queue')
| -rw-r--r-- | Mailman/Queue/BounceRunner.py | 9 | ||||
| -rw-r--r-- | Mailman/Queue/RetryRunner.py | 2 | ||||
| -rw-r--r-- | Mailman/Queue/Runner.py | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py index d398e1b4a..6ce7ef393 100644 --- a/Mailman/Queue/BounceRunner.py +++ b/Mailman/Queue/BounceRunner.py @@ -19,9 +19,9 @@ import os import re -import time import cPickle import logging +import datetime from email.MIMEMessage import MIMEMessage from email.MIMEText import MIMEText @@ -81,10 +81,11 @@ class BounceMixin: config.DATA_DIR, 'bounce-events-%05d.pck' % os.getpid()) self._bounce_events_fp = None self._bouncecnt = 0 - self._nextaction = time.time() + config.REGISTER_BOUNCES_EVERY + self._nextaction = (datetime.datetime.now() + + config.REGISTER_BOUNCES_EVERY) def _queue_bounces(self, listname, addrs, msg): - today = time.localtime()[:3] + today = datetime.date.today() if self._bounce_events_fp is None: self._bounce_events_fp = open(self._bounce_events_file, 'a+b') for addr in addrs: @@ -129,7 +130,7 @@ class BounceMixin: self._register_bounces() def _doperiodic(self): - now = time.time() + now = datetime.datetime.now() if self._nextaction > now or self._bouncecnt == 0: return # Let's go ahead and register the bounces we've got stored up diff --git a/Mailman/Queue/RetryRunner.py b/Mailman/Queue/RetryRunner.py index 9ecde0419..33e9459b5 100644 --- a/Mailman/Queue/RetryRunner.py +++ b/Mailman/Queue/RetryRunner.py @@ -38,4 +38,4 @@ class RetryRunner(Runner): def _snooze(self, filecnt): # We always want to snooze - time.sleep(self.SLEEPTIME) + time.sleep(float(self.SLEEPTIME)) diff --git a/Mailman/Queue/Runner.py b/Mailman/Queue/Runner.py index 9fb5434cc..958e11e6c 100644 --- a/Mailman/Queue/Runner.py +++ b/Mailman/Queue/Runner.py @@ -229,9 +229,9 @@ class Runner: based on this value. By default, we only snooze if there was nothing to do last time around. """ - if filecnt or self.SLEEPTIME <= 0: + if filecnt or float(self.SLEEPTIME) <= 0: return - time.sleep(self.SLEEPTIME) + time.sleep(float(self.SLEEPTIME)) def _shortcircuit(self): """Return a true value if the individual file processing loop should |
