From 29f70d98c46dd33a422572c0881b8030f3130312 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 11 Jan 2022 05:41:33 +0200 Subject: [PATCH] bbb --- files/routes/posts.py | 6 +++--- files/templates/header.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 3456fee54..4938dfb80 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -556,14 +556,14 @@ def thumbnail_thread(pid): db = db_session() - print(cpu_percent(), flush=True) + cpu = cpu_percent() time.sleep(0.1) cpu = cpu_percent() - if cpu > 5: - print('wtf', flush=True) + if cpu > 70: + print(f'Cpu usage at {cpu}%, Enabling under attack mode!', flush=True) with open('under_attack', 'r') as f: content = f.read() with open('under_attack', 'w') as f: diff --git a/files/templates/header.html b/files/templates/header.html index 1fd952e60..d71db984c 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -38,7 +38,7 @@ aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> {% if v and v.notifications_count %} - {{v.notifications_count}} + {{v.notifications_count}} {% endif %} @@ -60,7 +60,7 @@ {% if v.notifications_count %} {% else %}