Skip to content

Commit 36d0c46

Browse files
caspervonbwallyqs
authored andcommitted
Address review comments
1 parent 218cdf9 commit 36d0c46

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

nats/src/nats/js/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ def from_response(cls, resp: Dict[str, Any]):
339339

340340
def as_dict(self) -> Dict[str, object]:
341341
result = super().as_dict()
342-
result["inactive_threshold"] = self._to_nanoseconds(self.inactive_threshold)
342+
if self.inactive_threshold is not None:
343+
result["inactive_threshold"] = self._to_nanoseconds(self.inactive_threshold)
343344
return result
344345

345346

nats/tests/test_js.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5476,8 +5476,8 @@ async def test_stream_consumer_limits(self):
54765476
)
54775477

54785478
cinfo = await js.consumer_info("CONSUMERLIMITS", "consumer1")
5479-
# The consumer should have inherited or be constrained by stream limits
5480-
assert cinfo.config.max_ack_pending is not None
5479+
# The consumer should have inherited the stream's consumer limits
5480+
assert cinfo.config.max_ack_pending == 1000
54815481

54825482
# Test with only max_ack_pending set
54835483
await js.add_stream(

0 commit comments

Comments
 (0)