Skip to content

Commit

Permalink
fix: avoid loading redis if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
leio10 authored and SimFG committed Nov 25, 2023
1 parent 50bdeeb commit 272219b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gptcache/manager/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from gptcache.manager import CacheBase, VectorBase, ObjectBase
from gptcache.manager.data_manager import SSDataManager, MapDataManager
from gptcache.manager.eviction import EvictionBase
from gptcache.manager.scalar_data.redis_storage import RedisCacheStorage
from gptcache.utils.log import gptcache_log


Expand Down Expand Up @@ -107,7 +106,7 @@ def manager_factory(manager="map",
if eviction_params is None:
eviction_params = {}

if isinstance(s, RedisCacheStorage) and eviction_manager == "redis":
if scalar == "redis" and eviction_manager == "redis":
# if cache manager and eviction manager are both redis, we use no op redis to avoid redundant operations
eviction_manager = "no_op_eviction"
gptcache_log.info("Since Scalar Storage and Eviction manager are both redis, "
Expand Down

0 comments on commit 272219b

Please sign in to comment.