Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

detect

Endurance Idehen9d1ce18b6ed6
diff --git a/src/core_processor/app_events/event_notify.py b/src/core_processor/app_events/event_notify.py
index 393fafd8..ad1fc7ac 100644
--- a/src/core_processor/app_events/event_notify.py
+++ b/src/core_processor/app_events/event_notify.py
@@ -1,4 +1,3 @@
-import asyncio
import logging
from src.core_processor.app_events.app_queue import AppQueue
@@ -21,12 +20,11 @@ class EventNotifier:
async def notify_all_subscribers(self):
while True:
for webcam_id in self._webcam_ids:
- queue = self._app_queues.get_by_webcam_id(webcam_id) # type: asyncio.Queue
+ queue = self._app_queues.get_by_webcam_id(webcam_id)
try:
message = await queue.get()
- queue.task_done()
for worker in self._workers:
- worker.process(message)
+ await worker.process(message)
except Exception as e:
logger.error(e)
logger.error("Notifier dead")
diff --git a/src/core_processor/board_detection/detect.py b/src/core_processor/board_detection/detect.py
index a4ae9f74..57c3bcd4 100644
--- a/src/core_processor/board_detection/detect.py
+++ b/src/core_processor/board_detection/detect.py
@@ -8,5 +8,5 @@ class BoardDetection:
def __init__(self):
pass
- def process(self, message, *args, **kwargs):
- print(message["timestamp"])
+ async def process(self, message, *args, **kwargs):
+ logger.info(message["timestamp"])
diff --git a/src/core_processor/subscribers/subscribers.py b/src/core_processor/subscribers/subscribers.py
index 277ae6c8..5f6ea6b9 100644
--- a/src/core_processor/subscribers/subscribers.py
+++ b/src/core_processor/subscribers/subscribers.py
@@ -1,3 +1,3 @@
from src.core_processor.board_detection.detect import BoardDetection
-subscribers = [BoardDetection]
\ No newline at end of file
+subscribers = [BoardDetection]
diff --git a/src/core_processor/ws_connection.py b/src/core_processor/ws_connection.py
index 6500d5ea..dec08928 100644
--- a/src/core_processor/ws_connection.py
+++ b/src/core_processor/ws_connection.py
@@ -24,7 +24,7 @@ class WSConnection:
# How expensive is it to parse a json string?
asJson = orjson.loads(message)
await queue.put(asJson)
- print(f"webcam_id: {webcam_id}, msg rcv")
+ # print(f"webcam_id: {webcam_id}, msg rcv")
except websockets.ConnectionClosed as e:
logger.error(e)
continue