create new Database object for SqlCache

This commit is contained in:
Izalia Mae 2024-02-04 04:40:51 -05:00
parent 46413be2af
commit 64690a5c05

View file

@ -9,6 +9,7 @@ from dataclasses import asdict, dataclass
from datetime import datetime, timezone
from redis import Redis
from .database import get_database
from .misc import Message, boolean
if typing.TYPE_CHECKING:
@ -141,9 +142,9 @@ class SqlCache(Cache):
name: str = 'database'
@property
def _db(self) -> Database:
return self.app.database
def __init__(self, app: Application):
self._db = get_database(app.config)
Cache.__init__(self, app)
def get(self, namespace: str, key: str) -> Item: