Implemented memcached caching
This commit is contained in:
@@ -1,6 +1,21 @@
|
||||
import logging
|
||||
from logging import Logger
|
||||
|
||||
from libbot.pycord.classes import PycordBot
|
||||
|
||||
from classes.cache.holo_cache_memcached import HoloCacheMemcached
|
||||
from classes.cache.holo_cache_redis import HoloCacheRedis
|
||||
from modules.cache_utils import create_cache_client
|
||||
|
||||
logger: Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HoloBot(PycordBot):
|
||||
cache: HoloCacheMemcached | HoloCacheRedis | None = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def _set_cache_engine(self) -> None:
|
||||
if "cache" in self.config and self.config["cache"]["type"] is not None:
|
||||
self.cache = create_cache_client(self.config, self.config["cache"]["type"])
|
||||
|
Reference in New Issue
Block a user