notifier-draft-2
This commit is contained in:
7
main.py
7
main.py
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import asyncio
|
||||
from importlib import import_module
|
||||
from os.path import exists
|
||||
|
||||
@@ -8,10 +9,11 @@ from starlette.applications import Starlette
|
||||
|
||||
from services.schema import resolvers
|
||||
from services.rediscache import redis
|
||||
from services.keeper import notification_service
|
||||
from settings import DEV_SERVER_PID_FILE_NAME, SENTRY_DSN, MODE
|
||||
|
||||
import_module("resolvers")
|
||||
schema = make_executable_schema(load_schema_from_path("inbox.graphql"), resolvers) # type: ignore
|
||||
schema = make_executable_schema(load_schema_from_path("notifier.graphql"), resolvers) # type: ignore
|
||||
|
||||
|
||||
async def start_up():
|
||||
@@ -24,6 +26,9 @@ async def start_up():
|
||||
f.write(str(os.getpid()))
|
||||
else:
|
||||
await redis.connect()
|
||||
notification_service_task = asyncio.create_task(notification_service.worker())
|
||||
print(f"[main] {notification_service_task}")
|
||||
|
||||
try:
|
||||
import sentry_sdk
|
||||
|
||||
|
Reference in New Issue
Block a user