Skip to content

Commit 1ecc5e1

Browse files
authored
Support REQUEST_TIMEOUT status code for a batch fetch with no_wait=True (#618)
* Fixes #617
1 parent a63d3c4 commit 1ecc5e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nats/js/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ async def _fetch_n(
12441244
)
12451245
msg = await self._sub.next_msg(timeout=deadline)
12461246
status = JetStreamContext.is_status_msg(msg)
1247-
if status == api.StatusCode.NO_MESSAGES:
1247+
if status == api.StatusCode.NO_MESSAGES or status == api.StatusCode.REQUEST_TIMEOUT:
12481248
# No more messages after this so fallthrough
12491249
# after receiving the rest.
12501250
break

0 commit comments

Comments
 (0)