clear redis if no db state available

This commit is contained in:
Tim
2024-04-11 16:33:54 -04:00
parent ced92dbefd
commit af816e14d4

View File

@@ -83,12 +83,12 @@ async def main():
state = await db_state.load()
if state is None:
log.info('no state in database')
await redis_state.clear()
else:
current_blockstate.set(state)
if redis_state:
await redis_state.init(state, state.root_fork)
log.info(f'loaded state from db for root block {state.root_branch.height}')
runner = BlockStateRunner(state, publish_all=publish_all if redis_state else None)
setup_logevent_triggers(runner)
# OHLC printing hard-disabled for main. Use the finaldata process.