diff options
| author | bwarsaw | 2002-02-28 01:54:08 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-02-28 01:54:08 +0000 |
| commit | 0b3876f1bdd6fe6b32186b1d9e4bf494fe9b75f7 (patch) | |
| tree | 15e654de15ac12f3f00e7ae268a9e05764c51367 | |
| parent | 1bee2de5527f6e55b9198342dacf8d817d8a94c3 (diff) | |
| download | mailman-0b3876f1bdd6fe6b32186b1d9e4bf494fe9b75f7.tar.gz mailman-0b3876f1bdd6fe6b32186b1d9e4bf494fe9b75f7.tar.zst mailman-0b3876f1bdd6fe6b32186b1d9e4bf494fe9b75f7.zip | |
| -rw-r--r-- | Mailman/Queue/BounceRunner.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py index 17cef7893..f65e00740 100644 --- a/Mailman/Queue/BounceRunner.py +++ b/Mailman/Queue/BounceRunner.py @@ -121,13 +121,17 @@ class BounceRunner(Runner): for listname in Utils.list_names(): xlist = MailList.MailList(listname, lock=0) if xlist.isMember(addr): - xlist.Lock() + unlockp = 0 + if not xlist.Locked(): + xlist.Lock() + unlockp = 1 try: xlist.registerBounce(addr, msg) found = 1 xlist.Save() finally: - xlist.Unlock() + if unlockp: + xlist.Unlock() return found elif mlist.isMember(addr): mlist.registerBounce(addr, msg) @@ -139,14 +143,18 @@ class BounceRunner(Runner): found = 0 for listname in Utils.list_names(): xlist = MailList.MailList(listname, lock=0) - xlist.Lock() + unlockp = 0 + if not xlist.Locked(): + xlist.Lock() + unlockp = 1 try: status = BouncerAPI.ScanMessages(xlist, msg) if status: found = 1 xlist.Save() finally: - xlist.Unlock() + if unlockp: + xlist.Unlock() return found else: return BouncerAPI.ScanMessages(mlist, msg) |
