mirror of
https://github.com/microsoft/autogen.git
synced 2026-01-26 18:58:05 -05:00
Print warning if DiskCache when RedisCache requested (#1921)
This commit is contained in:
5
autogen/cache/cache_factory.py
vendored
5
autogen/cache/cache_factory.py
vendored
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user