Now smpt client will shutdown with SIGINTS

This commit is contained in:
Stranck 2024-02-29 11:42:05 +01:00
parent c6bc9c65ac
commit 9f191c3dec
1 changed files with 5 additions and 0 deletions

5
app.py
View File

@ -16,6 +16,7 @@ import requests
import sys
from sanic.log import logger, logging, access_logger
from metrics import *
from email_util import killSmptClient
import pretixClient
import traceback
@ -202,6 +203,10 @@ async def logout(request):
raise exceptions.Forbidden("You have been logged out.")
@app.signal("server.shutdown.before")
async def sigintHandler(app, loop):
killSmptClient()
@app.get(METRICS_PATH)
async def metrics(request):
return text(getMetricsText() + "\n" + getRoomCountersText(request))