Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nats/src/nats/js/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ async def _fetch_n(
# Return any message that was already available in the internal queue.
if msgs:
return msgs
raise
raise FetchTimeoutError

got_any_response = False

Expand Down Expand Up @@ -1286,14 +1286,14 @@ async def _fetch_n(
# timeout window.
deadline = JetStreamContext._time_until(timeout, start_time)
if deadline is not None and deadline <= 0:
raise asyncio.TimeoutError
raise FetchTimeoutError

next_req = {}
next_req["batch"] = needed
if deadline is not None:
remaining_expires = int(deadline * 1_000_000_000) - 100_000
if remaining_expires <= 0:
raise asyncio.TimeoutError
raise FetchTimeoutError
next_req["expires"] = remaining_expires
elif expires:
next_req["expires"] = expires
Expand Down
Loading