From 765cb5dd2836297a946e5a08cd6cf1cec67621fa Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Thu, 4 Mar 2004 14:06:01 +0000 Subject: Load(): Only gain the lock and attempt to repair the config file if file == plast or file == dlast. --- Mailman/MailList.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 68d2aae2..6ee0a00d 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -610,16 +610,18 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # copy the fallback into the primary so that the logic in Save() will # still work. For giggles, we'll copy it to a safety backup. Note we # MUST do this with the underlying list lock acquired. - unlock = True - try: + if file == plast or file == dlast: + syslog('error', 'fixing corrupt config files') + unlock = True try: - self.__lock.lock() - except LockFile.AlreadyLockedError: - unlock = False - self.__fix_corrupt_pckfile(file, pfile, plast, dfile, dlast) - finally: - if unlock: - self.__lock.unlock() + try: + self.__lock.lock() + except LockFile.AlreadyLockedError: + unlock = False + self.__fix_corrupt_pckfile(file, pfile, plast, dfile, dlast) + finally: + if unlock: + self.__lock.unlock() # Copy the loaded dictionary into the attributes of the current # mailing list object, then run sanity check on the data. self.__dict__.update(dict) -- cgit v1.2.3