diff options
| author | bwarsaw | 1999-12-15 23:13:21 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-12-15 23:13:21 +0000 |
| commit | c29e789a8297ebd7ec4f90731dc19d016dbaabb1 (patch) | |
| tree | 23bb31e6ba646651c493ff549029b5d19325b333 | |
| parent | b347e3cc6162f2ca57aa5f71a2d7aa1b0c3e79b5 (diff) | |
| download | mailman-c29e789a8297ebd7ec4f90731dc19d016dbaabb1.tar.gz mailman-c29e789a8297ebd7ec4f90731dc19d016dbaabb1.tar.zst mailman-c29e789a8297ebd7ec4f90731dc19d016dbaabb1.zip | |
| -rwxr-xr-x | cron/senddigests | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/cron/senddigests b/cron/senddigests index c3d2ff347..f580bd112 100755 --- a/cron/senddigests +++ b/cron/senddigests @@ -39,16 +39,26 @@ def main(): for listname in Utils.list_names(): mlist = MailList.MailList(listname, lock=0) if mlist.digest_send_periodic: - # send the digest if there are any partially built - digestfile = os.path.join(mlist.fullpath(), 'next-digest') - topicsfile = os.path.join(mlist.fullpath(), 'next-digest-topics') - try: - if os.stat(digestfile)[ST_SIZE] > 0: - ToDigest.inject_digest(mlist, digestfile, topicsfile) - except os.error, (code, msg): - if code <> ENOENT: - raise - # otherwise, this list doesn't have any outstanding digests + send_list_digest(mlist) + + +def send_list_digest(mlist): + mlist.Lock() + try: + # send the digest if there are any partially built + digestfile = os.path.join(mlist.fullpath(), 'next-digest') + topicsfile = os.path.join(mlist.fullpath(), 'next-digest-topics') + try: + if os.stat(digestfile)[ST_SIZE] > 0: + ToDigest.inject_digest(mlist, digestfile, topicsfile) + except os.error, (code, msg): + if code <> ENOENT: + raise + # otherwise, this list doesn't have any outstanding digests + finally: + mlist.Save() + mlist.Unlock() + if __name__ == "__main__": |
