restore-struct
Some checks failed
Deploy to core / deploy (push) Failing after 7s

This commit is contained in:
2024-02-19 10:14:14 +03:00
parent 7b8e9fbea6
commit e6720ccaaf
2 changed files with 10 additions and 28 deletions

15
main.py
View File

@@ -19,13 +19,13 @@ from settings import DEV_SERVER_PID_FILE_NAME, MODE
import_module('resolvers')
schema = make_executable_schema(load_schema_from_path('schema/'), resolvers)
start_sentry()
async def dev_pid():
# pid file management
if MODE == 'development' and not exists(DEV_SERVER_PID_FILE_NAME):
with open(DEV_SERVER_PID_FILE_NAME, 'w', encoding='utf-8') as f:
f.write(str(os.getpid()))
async def start():
if MODE == 'development':
if not exists(DEV_SERVER_PID_FILE_NAME):
# pid file management
with open(DEV_SERVER_PID_FILE_NAME, 'w', encoding='utf-8') as f:
f.write(str(os.getpid()))
print(f'[main] process started in {MODE} mode')
# main starlette app object with ariadne mounted in root
@@ -38,7 +38,8 @@ app = Starlette(
redis.connect,
ViewedStorage.init,
search_service.info,
dev_pid
start_sentry,
start
],
on_shutdown=[
redis.disconnect