mirror of https://github.com/pallets/flask.git
parent
18413ed1bf
commit
5b462dd382
|
|
@ -285,7 +285,7 @@ The following signals exist in Flask:
|
||||||
def close_db_connection(sender, **extra):
|
def close_db_connection(sender, **extra):
|
||||||
session.close()
|
session.close()
|
||||||
|
|
||||||
from flask import request_tearing_down
|
from flask import appcontext_tearing_down
|
||||||
appcontext_tearing_down.connect(close_db_connection, app)
|
appcontext_tearing_down.connect(close_db_connection, app)
|
||||||
|
|
||||||
This will also be passed an `exc` keyword argument that has a reference
|
This will also be passed an `exc` keyword argument that has a reference
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue