fix: config, list events table
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import uuid
|
||||
|
||||
from os import environ
|
||||
from functools import cached_property
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic_settings import BaseSettings
|
||||
@@ -43,7 +44,7 @@ class DefaultSettings(BaseSettings):
|
||||
REDIS_DB: int = int(environ.get("REDIS_DB", "0"))
|
||||
REDIS_PASSWORD: str = environ.get("REDIS_PASSWORD", "hackme")
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def database_settings(self) -> dict:
|
||||
"""Get all settings for connection with database."""
|
||||
return {
|
||||
@@ -54,7 +55,7 @@ class DefaultSettings(BaseSettings):
|
||||
"port": self.MYSQL_PORT,
|
||||
}
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def database_uri(self) -> str:
|
||||
"""Get uri for connection with database."""
|
||||
uri = "mysql+aiomysql://{user}:{password}@{host}:{port}/{database}".format(
|
||||
|
Reference in New Issue
Block a user