Implemented memcached caching

This commit is contained in:
2025-02-09 23:00:18 +01:00
parent d402c520a5
commit b3a7e3623a
20 changed files with 460 additions and 101 deletions

View File

@@ -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"])