summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-02-12 05:19:02 +0000
committerbwarsaw2002-02-12 05:19:02 +0000
commit3f633d7bc252b2efa5b2e86312a7de41ef35f3f7 (patch)
treef7e9e78360bba731538e19c0cf014dc86b2c58bf
parent807f60eac68c01a8c3177919ae109f93dc98759e (diff)
downloadmailman-3f633d7bc252b2efa5b2e86312a7de41ef35f3f7.tar.gz
mailman-3f633d7bc252b2efa5b2e86312a7de41ef35f3f7.tar.zst
mailman-3f633d7bc252b2efa5b2e86312a7de41ef35f3f7.zip
A slightly cleaner way to do the freshening of MailList objects.
run(): After once through the loop, look at the freshen flag and if true, clear the cache. Thus all subsequent MailList objects will get updated state, but we'll gain the performance benefits of the cache for each iteration the the big loop. _open_list(): Return this function to its original state.
Diffstat (limited to '')
-rw-r--r--Mailman/Queue/Runner.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Mailman/Queue/Runner.py b/Mailman/Queue/Runner.py
index f569911c7..f58e23be3 100644
--- a/Mailman/Queue/Runner.py
+++ b/Mailman/Queue/Runner.py
@@ -61,6 +61,11 @@ class Runner:
# Once through the loop that processes all the files in
# the queue directory.
filecnt = self.__oneloop()
+ # If the _freshen flag is set, then we evict all the
+ # MailList objects from the cache so that their state will
+ # be updated, the next time through the loop.
+ if self._freshen:
+ self._listcache.clear()
# Do the periodic work for the subclass. BAW: this
# shouldn't be called here. There should be one more
# _doperiodic() call at the end of the __oneloop() loop.
@@ -176,13 +181,7 @@ class Runner:
mlist = self._listcache.get(listname)
else:
mlist = None
- if mlist:
- # Non-locking runners should set this to true so that they'll be
- # sure they get fresh state. Locking runners don't need to do
- # this because the state is reloaded after locking the list.
- if self._freshen:
- mlist.Load()
- else:
+ if not mlist:
try:
mlist = MailList.MailList(listname, lock=0)
if self._cachelists: