summaryrefslogtreecommitdiff
path: root/Mailman/OutgoingQueue.py
diff options
context:
space:
mode:
authorbwarsaw1999-07-07 21:55:19 +0000
committerbwarsaw1999-07-07 21:55:19 +0000
commit4243d9d8178176021e7bdc96d5dbb4f1358b62bb (patch)
tree1c7e6b6d1518b17106da9b06219fe2a70a1bdeb4 /Mailman/OutgoingQueue.py
parentbd61ac47a20570136bc1a4bde9ac81cd9e9bd2fd (diff)
downloadmailman-4243d9d8178176021e7bdc96d5dbb4f1358b62bb.tar.gz
mailman-4243d9d8178176021e7bdc96d5dbb4f1358b62bb.tar.zst
mailman-4243d9d8178176021e7bdc96d5dbb4f1358b62bb.zip
Move the locking stuff from here to cron/run_queue. This way, I can
wrap the body of the code in a try/finally so the lock is definitely released should something bad happen.
Diffstat (limited to 'Mailman/OutgoingQueue.py')
-rw-r--r--Mailman/OutgoingQueue.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/Mailman/OutgoingQueue.py b/Mailman/OutgoingQueue.py
index b4ca0560e..6ad5cf5ba 100644
--- a/Mailman/OutgoingQueue.py
+++ b/Mailman/OutgoingQueue.py
@@ -38,6 +38,7 @@
import sys
import os
+import time
import stat
import marshal
import errno
@@ -69,24 +70,12 @@ QF_MODE = 0660
MAX_ACTIVE = 7200 # 2 hours
-
+# processQueue is called from cron/run_queue, which manages the lockfile
#
-# 1) get global lock so only of these
-# procedures can run at a time
-# 2) find all the files that are deferred queue
-# entries and all the files that have been in
-# an active state for too long and attempt a delivery
+# find all the files that are deferred queue entries and all the files that
+# have been in an active state for too long and attempt a delivery
#
def processQueue():
- import flock
- import time
- import Utils
-
- lock_file = flock.FileLock(
- os.path.join(mm_cfg.LOCK_DIR, "mmqueue_run.lock"),
- # running the queue can take a long time.
- hung_timeout=14400)
- lock_file.lock()
files = os.listdir(mm_cfg.DATA_DIR)
for file in files:
#
@@ -143,7 +132,6 @@ def processQueue():
l.write(' / %s' % v)
l.write('\n')
l.flush()
- lock_file.unlock()
#