Skip to content

Commit

Permalink
Merge pull request #56 from anwalker293/feat/record-with-vals/default…
Browse files Browse the repository at this point in the history
…-timeout

feat: add timeout to controller.py
  • Loading branch information
dbluhm authored Aug 29, 2023
2 parents 9283b73 + 85413aa commit 5165962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ async def record_with_values(
topic: str,
*,
record_type: Optional[Type[T]] = None,
timeout: Optional[int] = None, # seconds
**values,
) -> Union[T, Mapping[str, Any]]:
"""Get a record from an event with values matching those passed in."""
Expand All @@ -564,7 +565,8 @@ async def record_with_values(
lambda event: event.topic == topic
and all(
[event.payload.get(key) == value for key, value in values.items()]
)
),
timeout=timeout,
)
except asyncio.TimeoutError:
raise ControllerError(
Expand Down

0 comments on commit 5165962

Please sign in to comment.