Print warning if DiskCache when RedisCache requested (#1921)

This commit is contained in:
Jack Gerrits
2024-03-08 20:43:12 -05:00
committed by GitHub
parent f2465357cf
commit d447f7f646

View File

@@ -1,7 +1,9 @@
from typing import Optional, Union, Type
from typing import Optional, Union
from .abstract_cache_base import AbstractCache
from .disk_cache import DiskCache
import logging
class CacheFactory:
@staticmethod
@@ -45,6 +47,7 @@ class CacheFactory:
return RedisCache(seed, redis_url)
except ImportError:
logging.warning("RedisCache is not available. Creating a DiskCache instance instead.")
return DiskCache(f"./{cache_path_root}/{seed}")
else:
return DiskCache(f"./{cache_path_root}/{seed}")