Add catch for failure ending event

This commit is contained in:
Nick Mowen 2023-05-01 15:29:13 -06:00
parent d39b02e587
commit c2af257821
2 changed files with 10 additions and 8 deletions

View File

@ -217,6 +217,7 @@ class EventProcessor(threading.Thread):
Event.end_time: event_data["end_time"],
}
try:
(
Event.insert(event)
.on_conflict(
@ -225,3 +226,5 @@ class EventProcessor(threading.Thread):
)
.execute()
)
except Exception:
logger.warning(f"Failed to update manual event: {event_data['id']}")

View File

@ -889,7 +889,6 @@ def create_event(camera_name, label):
def end_event(event_id):
try:
current_app.external_processor.finish_manual_event(event_id)
# TODO we need some way to verify that the event id is valid, just check in the db?
except:
return jsonify(
{"success": False, "message": f"{event_id} must be set and valid."}, 404