inbox-debug-3
This commit is contained in:
26
main.py
26
main.py
@@ -20,17 +20,17 @@ schema = make_executable_schema(load_schema_from_path("inbox.graphql"), resolver
|
||||
|
||||
|
||||
async def start_up():
|
||||
await redis.connect()
|
||||
try:
|
||||
await redis.connect()
|
||||
|
||||
await CacheStorage.init()
|
||||
await CacheStorage.init()
|
||||
|
||||
if MODE == "dev":
|
||||
if 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()))
|
||||
else:
|
||||
# startup sentry monitoring services
|
||||
try:
|
||||
if MODE == "dev":
|
||||
if 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()))
|
||||
else:
|
||||
# startup sentry monitoring services
|
||||
import sentry_sdk
|
||||
|
||||
sentry_sdk.init(
|
||||
@@ -42,9 +42,11 @@ async def start_up():
|
||||
AioHttpIntegration(),
|
||||
],
|
||||
)
|
||||
except Exception as e:
|
||||
print("[sentry] init error")
|
||||
print(e)
|
||||
except Exception as e:
|
||||
print("STARTUP FAILED")
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
async def shutdown():
|
||||
|
Reference in New Issue
Block a user