File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1263,10 +1263,14 @@ async def next(self) -> _DocumentType:
12631263 self ._exhaust_checked = True
12641264 await self ._supports_exhaust ()
12651265 if self ._empty :
1266+ if self ._cursor_type == CursorType .NON_TAILABLE :
1267+ await self .close ()
12661268 raise StopAsyncIteration
12671269 if len (self ._data ) or await self ._refresh ():
12681270 return self ._data .popleft ()
12691271 else :
1272+ if self ._cursor_type == CursorType .NON_TAILABLE :
1273+ await self .close ()
12701274 raise StopAsyncIteration
12711275
12721276 async def _next_batch (self , result : list , total : Optional [int ] = None ) -> bool : # type: ignore[type-arg]
Original file line number Diff line number Diff line change @@ -1261,10 +1261,14 @@ def next(self) -> _DocumentType:
12611261 self ._exhaust_checked = True
12621262 self ._supports_exhaust ()
12631263 if self ._empty :
1264+ if self ._cursor_type == CursorType .NON_TAILABLE :
1265+ self .close ()
12641266 raise StopIteration
12651267 if len (self ._data ) or self ._refresh ():
12661268 return self ._data .popleft ()
12671269 else :
1270+ if self ._cursor_type == CursorType .NON_TAILABLE :
1271+ self .close ()
12681272 raise StopIteration
12691273
12701274 def _next_batch (self , result : list , total : Optional [int ] = None ) -> bool : # type: ignore[type-arg]
You can’t perform that action at this time.
0 commit comments