diff options
| author | cotton | 1998-11-02 14:45:09 +0000 |
|---|---|---|
| committer | cotton | 1998-11-02 14:45:09 +0000 |
| commit | 10f3bf437a4049f4dee2c6b03b324bdac749fa3e (patch) | |
| tree | cc878bc8f423c31958af6c1c39ecb9850c5665e7 /Mailman/OutgoingQueue.py | |
| parent | aa98464ae190aee8532d844ca582d44db31d02c5 (diff) | |
| download | mailman-10f3bf437a4049f4dee2c6b03b324bdac749fa3e.tar.gz mailman-10f3bf437a4049f4dee2c6b03b324bdac749fa3e.tar.zst mailman-10f3bf437a4049f4dee2c6b03b324bdac749fa3e.zip | |
Optimized and fixed run_queue so that when it calls
isDeferred(q_entry) it passes in the stat info from the previous
code, instead of stating the file twice. I had an active delivery
complete today between when run_queue checks to see if the file exists
with os.stat and when it calls isDeferred.
scott
Diffstat (limited to 'Mailman/OutgoingQueue.py')
| -rw-r--r-- | Mailman/OutgoingQueue.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Mailman/OutgoingQueue.py b/Mailman/OutgoingQueue.py index 0b82dbf61..980fdf830 100644 --- a/Mailman/OutgoingQueue.py +++ b/Mailman/OutgoingQueue.py @@ -99,7 +99,7 @@ def processQueue(): # it anyway. If the creation time was recent, leave it # alone as it's probably being delivered by another process anyway # - if not isDeferred(full_fname) and st[stat.ST_CTIME] > (time.time() - MAX_ACTIVE): + if not isDeferred(full_fname, st) and st[stat.ST_CTIME] > (time.time() - MAX_ACTIVE): continue f = open(full_fname,"r") recip,sender,text = marshal.load(f) @@ -136,8 +136,9 @@ def enqueueMessage(the_sender, recip, text): # # is this queue entry a deferred one? # -def isDeferred(q_entry): - st = os.stat(q_entry) +def isDeferred(q_entry, st=None): + if st is None: + st = os.stat(q_entry) size = st[stat.ST_SIZE] mode = st[stat.ST_MODE] if mode & stat.S_ISUID: |
