diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index 8b310a4bb..4a3862eaf 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -142,10 +142,11 @@ class Dispatcher: ) def handle_update_model_state(): - model = payload["model"] - state = payload["state"] - self.model_state[model] = ModelStatusTypesEnum[state] - self.publish("model_state", json.dumps(self.model_state)) + if payload: + model = payload["model"] + state = payload["state"] + self.model_state[model] = ModelStatusTypesEnum[state] + self.publish("model_state", json.dumps(self.model_state)) def handle_model_state(): self.publish("model_state", json.dumps(self.model_state.copy())) diff --git a/frigate/comms/inter_process.py b/frigate/comms/inter_process.py index 32cec49e4..850e2435c 100644 --- a/frigate/comms/inter_process.py +++ b/frigate/comms/inter_process.py @@ -65,8 +65,11 @@ class InterProcessRequestor: def send_data(self, topic: str, data: any) -> any: """Sends data and then waits for reply.""" - self.socket.send_json((topic, data)) - return self.socket.recv_json() + try: + self.socket.send_json((topic, data)) + return self.socket.recv_json() + except zmq.ZMQError: + return "" def stop(self) -> None: self.socket.close()