Skip to content

Commit

Permalink
feat: ignore file exist error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanViast committed Apr 28, 2024
1 parent 58a6fab commit c66b184
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions blockchainetl/streaming/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c66b184

Please sign in to comment.