Skip to content

Commit 366c7f0

Browse files
authored
Print warning if DiskCache when RedisCache requested (microsoft#1921)
1 parent 226a334 commit 366c7f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autogen/cache/cache_factory.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from typing import Optional, Union, Type
1+
from typing import Optional, Union
22
from .abstract_cache_base import AbstractCache
33
from .disk_cache import DiskCache
44

5+
import logging
6+
57

68
class CacheFactory:
79
@staticmethod
@@ -45,6 +47,7 @@ def cache_factory(
4547

4648
return RedisCache(seed, redis_url)
4749
except ImportError:
50+
logging.warning("RedisCache is not available. Creating a DiskCache instance instead.")
4851
return DiskCache(f"./{cache_path_root}/{seed}")
4952
else:
5053
return DiskCache(f"./{cache_path_root}/{seed}")

0 commit comments

Comments
 (0)