Skip to content

Commit 1eb6409

Browse files
committed
update
1 parent 8d2a1ae commit 1eb6409

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Mailman/Queue/CommandRunner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,13 @@ def _dispose(self, mlist, msg, msgdata):
282282
mailman_log('error', 'Message validation failed for command message')
283283
return False
284284

285-
# Get the MailList object
285+
# Get the list name from the mlist object
286286
try:
287+
listname = mlist.internal_name() if hasattr(mlist, 'internal_name') else str(mlist)
287288
MailList = get_maillist()
288-
mlist_obj = MailList(mlist, lock=False)
289+
mlist_obj = MailList(listname, lock=False)
289290
except Errors.MMListError as e:
290-
mailman_log('error', 'Failed to get MailList object for %s: %s', mlist, str(e))
291+
mailman_log('error', 'Failed to get MailList object for %s: %s', listname, str(e))
291292
return False
292293

293294
# The policy here is similar to the Replybot policy. If a message has

Mailman/Queue/Runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,14 @@ def _doperiodic(self):
413413

414414
def _snooze(self, filecnt):
415415
"""Sleep for a while, but check for stop flag periodically."""
416-
syslog('debug', 'Runner._snooze: Sleeping for %d seconds', self.SLEEPTIME)
416+
if filecnt > 0:
417+
syslog('debug', 'Runner._snooze: Sleeping for %d seconds after processing %d files',
418+
self.SLEEPTIME, filecnt)
417419
for _ in range(self.SLEEPTIME):
418420
if self._stop:
419421
syslog('debug', 'Runner._snooze: Stop flag detected, waking up')
420422
return
421423
time.sleep(1)
422-
syslog('debug', 'Runner._snooze: Sleep complete')
423424

424425
def _shortcircuit(self):
425426
"""Return a true value if the individual file processing loop should

0 commit comments

Comments
 (0)