diff --git a/frigate/object_detection/base.py b/frigate/object_detection/base.py index f97700e28..bb5f83fab 100644 --- a/frigate/object_detection/base.py +++ b/frigate/object_detection/base.py @@ -378,26 +378,15 @@ class RemoteObjectDetector: if self.stop_event.is_set(): return detections - # Drain any stale notifications from the ZMQ buffer before making a new request + # Drain any stale detection results from the ZMQ buffer before making a new request # This prevents reading detection results from a previous request - stale_count = 0 + # NOTE: This should never happen, but can in some rare cases while True: try: - stale_msg = self.detector_subscriber.socket.recv_string( - flags=zmq.NOBLOCK - ) - stale_count += 1 - logger.warning( - f"{self.name}: Drained stale notification #{stale_count}: {stale_msg}" - ) + self.detector_subscriber.socket.recv_string(flags=zmq.NOBLOCK) except zmq.Again: break - if stale_count > 0: - logger.warning( - f"{self.name}: Drained {stale_count} stale notification(s) before new detection request" - ) - # copy input to shared memory self.np_shm[:] = tensor_input[:] self.detection_queue.put(self.name)