diff options
| author | Barry Warsaw | 2009-02-12 22:26:28 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-02-12 22:26:28 -0500 |
| commit | 8b8586ca375b23787b5a74761773cd759f74994e (patch) | |
| tree | 13b74a80eb132184a763e3148392b0a9d80fd086 /src/mailman/bin/checkdbs.py | |
| parent | 62f4c909f90535986614a411db982bdcccaec3a1 (diff) | |
| download | mailman-8b8586ca375b23787b5a74761773cd759f74994e.tar.gz mailman-8b8586ca375b23787b5a74761773cd759f74994e.tar.zst mailman-8b8586ca375b23787b5a74761773cd759f74994e.zip | |
Diffstat (limited to 'src/mailman/bin/checkdbs.py')
| -rw-r--r-- | src/mailman/bin/checkdbs.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mailman/bin/checkdbs.py b/src/mailman/bin/checkdbs.py index 10d34aa22..c9789287b 100644 --- a/src/mailman/bin/checkdbs.py +++ b/src/mailman/bin/checkdbs.py @@ -140,6 +140,15 @@ def auto_discard(mlist): +# Figure out epoch seconds of midnight at the start of today (or the given +# 3-tuple date of (year, month, day). +def midnight(date=None): + if date is None: + date = time.localtime()[:3] + # -1 for dst flag tells the library to figure it out + return time.mktime(date + (0,)*5 + (-1,)) + + def main(): opts, args, parser = parseargs() config.load(opts.config) @@ -152,11 +161,11 @@ def main(): try: count = config.db.requests.get_list_requests(mlist).count # While we're at it, let's evict yesterday's autoresponse data - midnight_today = Utils.midnight() + midnight_today = midnight() evictions = [] for sender in mlist.hold_and_cmd_autoresponses.keys(): date, respcount = mlist.hold_and_cmd_autoresponses[sender] - if Utils.midnight(date) < midnight_today: + if midnight(date) < midnight_today: evictions.append(sender) if evictions: for sender in evictions: |
