init-strawberry
Some checks failed
deploy / deploy (push) Failing after 1m9s

This commit is contained in:
2023-11-26 13:18:57 +03:00
parent 8ef12063b0
commit 62c8d51c5d
13 changed files with 207 additions and 485 deletions

14
main.py
View File

@@ -1,20 +1,15 @@
import os
import asyncio
from importlib import import_module
from os.path import exists
from ariadne import load_schema_from_path, make_executable_schema
from ariadne.asgi import GraphQL
from strawberry.asgi import GraphQL
from starlette.applications import Starlette
from services.schema import resolvers
from services.rediscache import redis
from services.keeper import notification_service
from resolvers.listener import start as listener_start, stop as listener_stop
from resolvers.schema import schema
from settings import DEV_SERVER_PID_FILE_NAME, SENTRY_DSN, MODE
import_module("resolvers")
schema = make_executable_schema(load_schema_from_path("notifier.graphql"), resolvers) # type: ignore
async def start_up():
if MODE == "dev":
@@ -26,7 +21,7 @@ async def start_up():
f.write(str(os.getpid()))
else:
await redis.connect()
notification_service_task = asyncio.create_task(notification_service.worker())
notification_service_task = asyncio.create_task(listener_start())
print(f"[main] {notification_service_task}")
try:
@@ -39,6 +34,7 @@ async def start_up():
async def shutdown():
listener_stop()
await redis.disconnect()