diff options
| author | Barry Warsaw | 2007-10-10 23:22:03 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-10-10 23:22:03 -0400 |
| commit | 1ad73a52bb9d82ef3af1e34ad9ef66ac2eda2909 (patch) | |
| tree | 7985eda24e60a39d58c54436e99f975610ee947d /Mailman/queue/incoming.py | |
| parent | 15f9e73fdb96a145632e5916cc0073472c014c99 (diff) | |
| download | mailman-1ad73a52bb9d82ef3af1e34ad9ef66ac2eda2909.tar.gz mailman-1ad73a52bb9d82ef3af1e34ad9ef66ac2eda2909.tar.zst mailman-1ad73a52bb9d82ef3af1e34ad9ef66ac2eda2909.zip | |
General cleanups some of which is even tested <wink>. Mailman.LockFile module
is moved to Mailman.lockfile.
Remove a few more MailList methods that aren't used any more, e.g. the lock
related stuff, the Save() and CheckValues() methods, as well as
ChangeMemberName().
Add a missing import to lifecycle.py.
We no longer need withlist to unlock the mailing list. Also, expose
config.db.flush() in the namespace of withlist directly, under 'flush'.
Diffstat (limited to 'Mailman/queue/incoming.py')
| -rw-r--r-- | Mailman/queue/incoming.py | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/Mailman/queue/incoming.py b/Mailman/queue/incoming.py index 05ab924e6..6118a7ca0 100644 --- a/Mailman/queue/incoming.py +++ b/Mailman/queue/incoming.py @@ -102,7 +102,6 @@ import logging from cStringIO import StringIO from Mailman import Errors -from Mailman import LockFile from Mailman.configuration import config from Mailman.queue import Runner @@ -117,12 +116,6 @@ class IncomingRunner(Runner): def _dispose(self, mlist, msg, msgdata): if msgdata.get('envsender') is None: msg['envsender'] = mlist.no_reply_address - # Try to get the list lock. - try: - mlist.Lock(timeout=config.LIST_LOCK_TIMEOUT) - except LockFile.TimeOutError: - # Oh well, try again later - return 1 # Process the message through a handler pipeline. The handler # pipeline can actually come from one of three places: the message # metadata, the mlist, or the global pipeline. @@ -131,16 +124,13 @@ class IncomingRunner(Runner): # will contain the retry pipeline. Use this above all else. # Otherwise, if the mlist has a `pipeline' attribute, it should be # used. Final fallback is the global pipeline. - try: - pipeline = self._get_pipeline(mlist, msg, msgdata) - msgdata['pipeline'] = pipeline - more = self._dopipeline(mlist, msg, msgdata, pipeline) - if not more: - del msgdata['pipeline'] - mlist.Save() - return more - finally: - mlist.Unlock() + pipeline = self._get_pipeline(mlist, msg, msgdata) + msgdata['pipeline'] = pipeline + more = self._dopipeline(mlist, msg, msgdata, pipeline) + if not more: + del msgdata['pipeline'] + config.db.commit() + return more # Overridable def _get_pipeline(self, mlist, msg, msgdata): |
