Now smpt client will shutdown with SIGINTS
This commit is contained in:
parent
c6bc9c65ac
commit
9f191c3dec
5
app.py
5
app.py
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue