From c66b1841e71865f2e6dd58e7e9ce6726afa99108 Mon Sep 17 00:00:00 2001 From: AlanViast Date: Sun, 28 Apr 2024 16:48:27 +0800 Subject: [PATCH] feat: ignore file exist error --- blockchainetl/streaming/streamer.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/blockchainetl/streaming/streamer.py b/blockchainetl/streaming/streamer.py index 998d24108..75ed4d98e 100644 --- a/blockchainetl/streaming/streamer.py +++ b/blockchainetl/streaming/streamer.py @@ -139,12 +139,8 @@ def write_last_synced_block(file, last_synced_block): def init_last_synced_block_file(start_block, last_synced_block_file): - if os.path.isfile(last_synced_block_file): - raise ValueError( - '{} should not exist if --start-block option is specified. ' - 'Either remove the {} file or the --start-block option.' - .format(last_synced_block_file, last_synced_block_file)) - write_last_synced_block(last_synced_block_file, start_block) + if not os.path.exists(last_synced_block_file): + write_last_synced_block(last_synced_block_file, start_block) def read_last_synced_block(file):