From 4a111df2783f09484300665564442aabbdc8d99b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 22 Aug 2022 23:02:20 +0200 Subject: [PATCH] make chat count 0 in localhost --- files/__main__.py | 2 ++ files/routes/chat.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/__main__.py b/files/__main__.py index 79d2e7b21..ac36b5c5f 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -125,6 +125,8 @@ def teardown_request(error): del g.db stdout.flush() +cache.set(f'{app.config["SERVER_NAME"]}_online', 0, timeout=0) + if app.config["SERVER_NAME"] == 'localhost': from files.routes import * # from files.routes.chat import * diff --git a/files/routes/chat.py b/files/routes/chat.py index 89201cd04..6a1ccac6e 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -18,7 +18,6 @@ else: typing = [] online = [] -cache.set(ONLINE_STR, len(online), timeout=0) muted = cache.get(f'{SITE}_muted') or {} messages = cache.get(f'{SITE}_chat') or [] total = cache.get(f'{SITE}_total') or 0