Skip to content

Commit 90492f0

Browse files
author
Zach Moody
committed
Fix threaded returns
1 parent d2c6b16 commit 90492f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pynetbox/core/query.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(
130130
base,
131131
http_session,
132132
filters=None,
133-
limit=0,
133+
limit=None,
134134
key=None,
135135
token=None,
136136
private_key=None,
@@ -307,6 +307,8 @@ def get(self, add_params=None):
307307
endpoint.
308308
"""
309309

310+
if not add_params and self.limit is not None:
311+
add_params = {"limit": self.limit}
310312
req = self._make_call(add_params=add_params)
311313
if isinstance(req, dict) and req.get("results") is not None:
312314
self.count = req["count"]
@@ -323,7 +325,8 @@ def get(self, add_params=None):
323325
ret.extend(req["results"])
324326
else:
325327
self.concurrent_get(ret, page_size, page_offsets)
326-
return ret
328+
for i in ret:
329+
yield i
327330
first_run = True
328331
for i in req["results"]:
329332
yield i

0 commit comments

Comments
 (0)