From 8623f4082ba6766a7a5fcc75ad1de8ed32ad3bb4 Mon Sep 17 00:00:00 2001 From: Eldar Gabdullin Date: Wed, 27 Mar 2024 00:42:04 +0300 Subject: [PATCH] fix erroneous writer cli change introduced by prev commit --- sqa/writer/cli.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sqa/writer/cli.py b/sqa/writer/cli.py index 8c67dc1..85e804f 100644 --- a/sqa/writer/cli.py +++ b/sqa/writer/cli.py @@ -113,19 +113,24 @@ def _start_prometheus_metrics(self): def _ingest(self) -> Iterable[list[Block]]: args = self._arguments() writer = self._writer() + first_block = self._sink().get_next_block() + last_block = args.last_block + + if last_block is not None and first_block > last_block: + return if args.src: blocks = ingest_from_service( args.src, writer.get_block_height, - args.first_block, - args.last_block + first_block, + last_block ) else: blocks = ingest_from_stdin( writer.get_block_height, - args.first_block, - args.last_block + first_block, + last_block ) pack = []