This commit is contained in:
2025-05-06 20:16:44 +02:00
parent d1498f38e9
commit 96c1314234
5 changed files with 33 additions and 199 deletions

View File

@@ -2,6 +2,7 @@ from abc import ABC
from logging import Logger
from typing import Optional, Any, Dict
from bson import ObjectId
from libbot.cache.classes import Cache
from classes.abstract import Cacheable
@@ -13,6 +14,8 @@ logger: Logger = get_logger(__name__)
class BaseCacheable(Cacheable, ABC):
"""Base implementation of Cacheable used by all cachable classes."""
_id: ObjectId
async def _set(self, cache: Optional[Cache] = None, **kwargs: Any) -> None:
for key, value in kwargs.items():
if not hasattr(self, key):