From 829db5684b0d60e674983970c74bdfa7180e7d81 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 25 Dec 2022 08:14:30 +0200 Subject: [PATCH] perserve site stats on cache.clear() --- files/routes/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 00f0bb760..5210638de 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -173,8 +173,10 @@ def move_acc(v:User, new_id, old_id): g.db.commit() + stats = cache.get(f'{SITE}_stats') online = cache.get(CHAT_ONLINE_CACHE_KEY) cache.clear() + cache.set(f'{SITE}_stats', stats) cache.set(CHAT_ONLINE_CACHE_KEY, online) return redirect(f"/id/{old_id}")