Skip to content

Commit

Permalink
try guards
Browse files Browse the repository at this point in the history
  • Loading branch information
mgineer85 committed Nov 14, 2024
1 parent 1bf7bb7 commit 03e79ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wigglecam/services/acquisitionservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _sync_fun(self):
timestamp_ns = self._gpio_backend.wait_for_clock_rise_signal(timeout=1)
except TimeoutError:
# stop devices when no clock is avail, supervisor enables again after clock is received, derives new framerate ans starts backends
logger.error("clock signal missing.")
logger.warning("clock signal missing.")
break
else:
self._camera_backend.sync_tick(timestamp_ns)
Expand Down
7 changes: 5 additions & 2 deletions wigglecam/services/backends/cameras/abstractbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass
from queue import Full, Queue
from queue import Empty, Full, Queue
from threading import Barrier, BrokenBarrierError, Condition, Event, current_thread
from typing import Literal

Expand Down Expand Up @@ -149,7 +149,10 @@ def _ticker_fun(self):
logger.debug("starting _ticker_fun")

while not current_thread().stopped():
self._current_timestampset.reference = self._current_timestamp_reference_in_queue.get(block=True, timeout=1.0)
try:
self._current_timestampset.reference = self._current_timestamp_reference_in_queue.get(block=True, timeout=1.0)
except Empty:
logger.warning("did not receive updated reference timestamp within timeout")

try:
self._barrier.wait()
Expand Down

0 comments on commit 03e79ad

Please sign in to comment.