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:
1263
1263
self ._exhaust_checked = True
1264
1264
await self ._supports_exhaust ()
1265
1265
if self ._empty :
1266
+ if self ._cursor_type == CursorType .NON_TAILABLE :
1267
+ await self .close ()
1266
1268
raise StopAsyncIteration
1267
1269
if len (self ._data ) or await self ._refresh ():
1268
1270
return self ._data .popleft ()
1269
1271
else :
1272
+ if self ._cursor_type == CursorType .NON_TAILABLE :
1273
+ await self .close ()
1270
1274
raise StopAsyncIteration
1271
1275
1272
1276
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:
1261
1261
self ._exhaust_checked = True
1262
1262
self ._supports_exhaust ()
1263
1263
if self ._empty :
1264
+ if self ._cursor_type == CursorType .NON_TAILABLE :
1265
+ self .close ()
1264
1266
raise StopIteration
1265
1267
if len (self ._data ) or self ._refresh ():
1266
1268
return self ._data .popleft ()
1267
1269
else :
1270
+ if self ._cursor_type == CursorType .NON_TAILABLE :
1271
+ self .close ()
1268
1272
raise StopIteration
1269
1273
1270
1274
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