Merge branch 'faster-testing'
This commit is contained in:
commit
4000632829
6 changed files with 71 additions and 26 deletions
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
|
||||
from app import app as application
|
||||
from data.model import db as model_db
|
||||
|
||||
|
||||
logging.basicConfig(**application.config['LOGGING_CONFIG'])
|
||||
|
@ -30,6 +31,16 @@ application.register_blueprint(registry, url_prefix='/v1')
|
|||
application.register_blueprint(api, url_prefix='/api')
|
||||
application.register_blueprint(webhooks, url_prefix='/webhooks')
|
||||
|
||||
|
||||
def close_db(exc):
|
||||
db = model_db
|
||||
if not db.is_closed():
|
||||
logger.debug('Disconnecting from database.')
|
||||
db.close()
|
||||
|
||||
application.teardown_request(close_db)
|
||||
|
||||
|
||||
# Remove this for prod config
|
||||
application.debug = True
|
||||
|
||||
|
|
Reference in a new issue