From bac8cc48eec9a2c8cdcb18f0207271838d5757bb Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Thu, 13 Jan 2022 16:34:13 +0800 Subject: [PATCH] fix(fastrun): fallback when redis config is empty GitOrigin-RevId: b61630d00723b73477f57ad1b4365d22ba9bf61a --- .../python/megengine/utils/persistent_cache.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/imperative/python/megengine/utils/persistent_cache.py b/imperative/python/megengine/utils/persistent_cache.py index d517b9226..b6aadf8ad 100644 --- a/imperative/python/megengine/utils/persistent_cache.py +++ b/imperative/python/megengine/utils/persistent_cache.py @@ -34,12 +34,13 @@ class PersistentCacheOnServer(_PersistentCache): "in-file cache".format(exc) ) else: - self.add_config( - "redis", - redis_config, - "fastrun use redis cache", - "failed to connect to cache server", - ) + if redis_config is not None: + self.add_config( + "redis", + redis_config, + "fastrun use redis cache", + "failed to connect to cache server", + ) if cache_type != "MEMORY": path = self.get_cache_file(self.get_cache_dir()) self.add_config( -- GitLab