Skip to content

Commit 8110413

Browse files
authored
Simple queue fixes (#12014)
1 parent 205cf3a commit 8110413

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ydb/tools/simple_queue/__main__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,26 +377,27 @@ def write(self):
377377
)
378378

379379
def move_iterator(self, it, callback):
380-
try:
381-
next_f = next(it)
382-
next_f.add_done_callback(lambda x: callback(it, x))
383-
except StopIteration:
384-
return
380+
next_f = next(it)
381+
next_f.add_done_callback(lambda x: callback(it, x))
385382

386383
def on_read_table_chunk(self, it, f):
387384
try:
388385
f.result()
389386
self.stats.save_event(EventKind.READ_TABLE_CHUNK)
390387
except ydb.Error as e:
391-
self.stats.save_event(EventKind.READ_TABLE_CHUNK, e)
388+
self.stats.save_event(EventKind.READ_TABLE_CHUNK, e.status)
389+
except StopIteration:
390+
return
392391
self.move_iterator(it, self.on_read_table_chunk)
393392

394393
def on_scan_query_chunk(self, it, f):
395394
try:
396395
f.result()
397396
self.stats.save_event(EventKind.SCAN_QUERY_CHUNK)
398397
except ydb.Error as e:
399-
self.stats.save_event(EventKind.SCAN_QUERY_CHUNK, e)
398+
self.stats.save_event(EventKind.SCAN_QUERY_CHUNK, e.status)
399+
except StopIteration:
400+
return
400401

401402
self.move_iterator(it, self.on_scan_query_chunk)
402403

0 commit comments

Comments
 (0)