From a0f64b5ddc86ab45bc285ed3e14e156ddbc135d1 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 26 Jul 2024 01:40:52 -0400 Subject: [PATCH] bugfix --- src/dexorder/bin/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dexorder/bin/main.py b/src/dexorder/bin/main.py index efa8eb6..a8312e9 100644 --- a/src/dexorder/bin/main.py +++ b/src/dexorder/bin/main.py @@ -72,6 +72,8 @@ async def main(): if memcache: await memcache.connect() redis_state = RedisState(BlockData.by_opt('redis')) + else: + log.debug('No memcache') db.connect() if db: db_state = DbState(BlockData.by_opt('db')) @@ -79,7 +81,8 @@ async def main(): state = await db_state.load() if state is None: log.info('no state in database') - await redis_state.clear() + if redis_state: + await redis_state.clear() else: current_blockstate.set(state) current_fork.set(state.root_fork)