diff --git a/aggregator.py b/aggregator.py index cda70cb..d5679f8 100644 --- a/aggregator.py +++ b/aggregator.py @@ -271,12 +271,12 @@ def clear_event(): event_id = str(data["id"]) with events_lock: - if event_id in active_events: - del active_events[event_id] - state = write_status() - return jsonify({"status": "cleared", "current_state": state}), 200 - else: + if event_id not in active_events: return jsonify({"error": "Event not found"}), 404 + del active_events[event_id] + + state = write_status() + return jsonify({"status": "cleared", "current_state": state}), 200 @app.route("/notify", methods=["POST"]) diff --git a/index.html b/index.html index f4556a0..5c0f084 100644 --- a/index.html +++ b/index.html @@ -216,7 +216,7 @@