diff options
Diffstat (limited to 'cgi/post.py')
-rw-r--r-- | cgi/post.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cgi/post.py b/cgi/post.py index cb531dd..741bebb 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -831,7 +831,8 @@ def trimThreads(): alert_time = int(round(board['maxage'] * Settings.MAX_AGE_ALERT)) time_limit = t + (alert_time * 86400) old_ops = FetchAll("SELECT `id`, `timestamp`, `expires`, `expires_alert`, `length` FROM `posts` WHERE `boardid` = %s AND `parentid` = 0 AND IS_DELETED = 0 AND `expires` > 0 AND `expires` < %s LIMIT 50", (board['id'], time_limit)) - + logging.debug("Old OPs 1: " + repr(old_ops)) + for op in old_ops: if t >= op['expires']: # Trim old threads @@ -851,6 +852,7 @@ def trimThreads(): oldest_last = t - (board['maxinactive'] * 86400) old_ops = FetchAll("SELECT `id`, `length` FROM `posts` WHERE `boardid` = %s AND `parentid` = 0 AND IS_DELETED = 0 AND `last` < %s LIMIT 50", (board['id'], oldest_last)) + logging.debug("Old OPs 2: " + repr(old_ops)) for op in old_ops: if board['archive'] and op["length"] >= Settings.ARCHIVE_MIN_LENGTH: @@ -878,6 +880,7 @@ def trimThreads(): op_posts = FetchAll("SELECT `id`, `length` FROM `posts` WHERE `boardid` = %s AND `parentid` = 0 AND IS_DELETED = 0 ORDER BY %s" % (board["id"], order)) if len(op_posts) > limit: posts = op_posts[limit:] + logging.debug("Old OPs 3: " + repr(posts)) for post in posts: if board['archive'] and op["length"] >= Settings.ARCHIVE_MIN_LENGTH: archiveThread(post["id"]) @@ -889,6 +892,7 @@ def trimThreads(): if archived: regenerateKako() + logging.debug("Trimmed threads: " + repr(trimmed)) return trimmed def autoclose_thread(parentid, t, replies): |