From b573404bb8ce568f535bc606ff283642150a41fe Mon Sep 17 00:00:00 2001 From: Someone Date: Fri, 13 Sep 2024 19:01:51 +0200 Subject: [PATCH] maintenance/db.py --- maintenance/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maintenance/db.py b/maintenance/db.py index 3c7fdc4..af22f48 100755 --- a/maintenance/db.py +++ b/maintenance/db.py @@ -15,7 +15,7 @@ import psycopg2.extras import config print("Mattermost DB cleanup script: https://git.somenet.org/pub/jan/mattermost-privileged.git") -print("Tested on 9.5\n") +print("Tested on 9.11\n") dbconn = psycopg2.connect(config.dbconnstring) dbconn.set_session(autocommit=False) @@ -148,7 +148,7 @@ cur = dbconn.cursor(cursor_factory=psycopg2.extras.DictCursor) # posts cur.execute("""DELETE FROM posts WHERE deleteat <> 0 AND deleteat < extract(epoch from (NOW() - INTERVAL '14 day'))*1000 RETURNING *""") -print(f"* [{(time.time() - TS_START):08.5f}] {cur.rowcount} deleted 'deleted' post(s). (14 day delay for delete propagation/cache eviction)") +print(f"* [{(time.time() - TS_START):08.5f}] {cur.rowcount} deleted 'deleted' post(s).") # drafts cur.execute("""DELETE FROM drafts WHERE deleteat <> 0 OR message = '' RETURNING *""") -- 2.43.0