Skip to content

Commit

Permalink
Don't hardcode import redis and memcached in factory (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
argaen authored Jul 31, 2019
1 parent 79c77b3 commit 210ce20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aiocache/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings

from aiocache.exceptions import InvalidCacheType
from aiocache import AIOCACHE_CACHES, SimpleMemoryCache, RedisCache, MemcachedCache
from aiocache import AIOCACHE_CACHES
from aiocache.base import BaseCache


Expand Down Expand Up @@ -56,9 +56,9 @@ class Cache:
:class:`aiocache.exceptions.InvalidCacheType` exception.
"""

MEMORY = SimpleMemoryCache
REDIS = RedisCache
MEMCACHED = MemcachedCache
MEMORY = AIOCACHE_CACHES["memory"]
REDIS = AIOCACHE_CACHES.get("redis")
MEMCACHED = AIOCACHE_CACHES.get("memcached")

def __new__(cls, cache_class=MEMORY, **kwargs):
try:
Expand Down

0 comments on commit 210ce20

Please sign in to comment.