[Enhance][Bug fix] Waitress & API token

- Fix a bug that using API token in config file will not success
- Add deployment mode `waitress`
This commit is contained in:
Lost-MSth
2022-11-03 13:42:39 +08:00
parent 3fde61c639
commit 78d28f8886
4 changed files with 20 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import sqlite3
import traceback
from atexit import register
from flask import current_app
@@ -367,5 +368,7 @@ class MemoryDatabase:
'''create index if not exists download_token_1 on download_token (song_id, file_name);''')
self.conn.commit()
def atexit(self):
self.conn.close()
@register
def atexit():
MemoryDatabase.conn.close()