Skip to content

Commit

Permalink
Print warning if DiskCache when RedisCache requested (microsoft#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Mar 9, 2024
1 parent 226a334 commit 366c7f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogen/cache/cache_factory.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -45,6 +47,7 @@ def cache_factory(

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}")

0 comments on commit 366c7f0

Please sign in to comment.