From 8f950f8de53aa7bc1e80bddf09aad8db6ed3e006 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 12 Sep 2024 15:44:53 +1000 Subject: [PATCH] feat: Add logging when discord token not found --- server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index f1dc491..4573d2d 100644 --- a/server.py +++ b/server.py @@ -392,7 +392,10 @@ def send_notification(title, description,author): "attachments": [], } response = requests.post(discord_hook, json=data) - print(response.text, flush=True) + print("Sent notification", flush=True) + else: + print("No discord hook", flush=True) + def send_down_notification(node): title = f"{node['name']} is down" @@ -624,6 +627,10 @@ def api_all(): history = get_history(history_days) return jsonify(history) +@app.route("/api/refresh") +def api_refresh(): + node_status = check_nodes() + return jsonify(node_status) # endregion