mirror of https://github.com/Aidaho12/haproxy-wi
parent
5e2fadc75e
commit
658f524d18
|
@ -3,6 +3,7 @@ from playhouse.migrate import *
|
|||
from datetime import datetime
|
||||
from flask_login import UserMixin
|
||||
|
||||
from app import app
|
||||
import modules.roxy_wi_tools as roxy_wi_tools
|
||||
|
||||
get_config = roxy_wi_tools.GetConfigVar()
|
||||
|
@ -22,6 +23,12 @@ else:
|
|||
migrator = SqliteMigrator(conn)
|
||||
|
||||
|
||||
@app.teardown_request
|
||||
def _db_close(exc):
|
||||
if not conn.is_closed():
|
||||
conn.close()
|
||||
|
||||
|
||||
class BaseModel(Model):
|
||||
class Meta:
|
||||
database = conn
|
||||
|
|
Loading…
Reference in New Issue