From fb0b92364a498169de94318ce754112e257d7c29 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 26 Sep 2023 23:59:56 +0300 Subject: [PATCH] fix /refresh_chat once and for all --- files/helpers/cron.py | 4 ++-- files/routes/admin.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index e4fe16433..b56de36bc 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -185,7 +185,7 @@ def _create_and_delete_orgy(): del g.db stdout.flush() - requests.post('http://localhost:5001/refresh_chat') + requests.post('http://localhost:5001/refresh_chat', headers={"Host": SITE}) video_info = ffmpeg.probe(f'/orgies/{get_file()}') seconds = int(video_info['streams'][0]['duration']) @@ -195,7 +195,7 @@ def _create_and_delete_orgy(): if orgy: g.db.delete(orgy) g.db.commit() - requests.post('http://localhost:5001/refresh_chat') + requests.post('http://localhost:5001/refresh_chat', headers={"Host": SITE}) def _delete_all_posts(): posts = g.db.query(Post).filter_by(author_id=AUTOJANNY_ID, deleted_utc=0).all() diff --git a/files/routes/admin.py b/files/routes/admin.py index 5500d419b..623418e31 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1979,8 +1979,7 @@ def start_orgy(v): g.db.add(orgy) g.db.commit() - x = requests.post('http://localhost:5001/refresh_chat', headers={"Host": SITE}) - print(x.text, flush=True) + requests.post('http://localhost:5001/refresh_chat', headers={"Host": SITE}) return redirect('/chat') @@ -1988,5 +1987,5 @@ def start_orgy(v): @admin_level_required(PERMS['ORGIES']) def stop_orgy(v): g.db.query(Orgy).delete() - requests.post('http://localhost:5001/refresh_chat') + requests.post('http://localhost:5001/refresh_chat', headers={"Host": SITE}) return {"message": "Orgy stopped successfully!"}