mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 23:41:09 +00:00
create new Database object for SqlCache
This commit is contained in:
parent
46413be2af
commit
64690a5c05
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue