avoid comments endless loop - check if query_response is always the same (#1347)
This commit is contained in:
parent
470fc0d905
commit
815ba83d77
@ -133,14 +133,15 @@ class NodeIterator(Iterator[T]):
|
|||||||
return item
|
return item
|
||||||
if self._data['page_info']['has_next_page']:
|
if self._data['page_info']['has_next_page']:
|
||||||
query_response = self._query(self._data['page_info']['end_cursor'])
|
query_response = self._query(self._data['page_info']['end_cursor'])
|
||||||
page_index, data = self._page_index, self._data
|
if self._data['edges'] != query_response['edges']:
|
||||||
try:
|
page_index, data = self._page_index, self._data
|
||||||
self._page_index = 0
|
try:
|
||||||
self._data = query_response
|
self._page_index = 0
|
||||||
except KeyboardInterrupt:
|
self._data = query_response
|
||||||
self._page_index, self._data = page_index, data
|
except KeyboardInterrupt:
|
||||||
raise
|
self._page_index, self._data = page_index, data
|
||||||
return self.__next__()
|
raise
|
||||||
|
return self.__next__()
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user