This commit is contained in:
Igor Lobanov
2023-10-26 19:56:42 +02:00
parent 44bd146bdf
commit 2c524279f6
65 changed files with 802 additions and 1049 deletions

View File

@@ -1,8 +1,8 @@
from graphql.error import GraphQLError
# TODO: remove traceback from logs for defined exceptions
class BaseHttpException(GraphQLError):
code = 500
message = "500 Server error"

View File

@@ -1,15 +1,13 @@
from typing import TypeVar, Any, Dict, Generic, Callable
from typing import Any, Callable, Dict, Generic, TypeVar
from sqlalchemy import create_engine, Column, Integer
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
from sqlalchemy.sql.schema import Table
from settings import DB_URL
engine = create_engine(
DB_URL, echo=False, pool_size=10, max_overflow=20
)
engine = create_engine(DB_URL, echo=False, pool_size=10, max_overflow=20)
T = TypeVar("T")
@@ -47,7 +45,7 @@ class Base(declarative_base()):
def update(self, input):
column_names = self.__table__.columns.keys()
for (name, value) in input.items():
for name, value in input.items():
if name in column_names:
setattr(self, name, value)

View File

@@ -1,5 +1,7 @@
from aioredis import from_url
from asyncio import sleep
from aioredis import from_url
from settings import REDIS_URL