Skip to content

Commit

Permalink
Removed timeout if stream datum takes too long to be produced (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
rosesyrett authored Nov 13, 2023
1 parent 2570efd commit 0f79403
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/ophyd_async/epics/areadetector/writers/_hdffile.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import time
from typing import Iterator, List

from event_model import StreamDatum, StreamResource, compose_stream_resource

from ._hdfdataset import _HDFDataset

FRAME_TIMEOUT = 120


class _HDFFile:
def __init__(self, full_file_name: str, datasets: List[_HDFDataset]) -> None:
self._last_emitted = 0
self._last_flush = time.monotonic()
self._bundles = [
compose_stream_resource(
spec="AD_HDF5_SWMR_SLICE",
Expand Down Expand Up @@ -39,9 +35,6 @@ def stream_data(self, indices_written: int) -> Iterator[StreamDatum]:
stop=indices_written,
)
self._last_emitted = indices_written
self._last_flush = time.monotonic()
for bundle in self._bundles:
yield bundle.compose_stream_datum(indices)
if time.monotonic() - self._last_flush > FRAME_TIMEOUT:
raise TimeoutError(f"Writing stalled on frame {indices_written}")
return None

0 comments on commit 0f79403

Please sign in to comment.