MCPcopy Create free account
hub / github.com/pallets/flask / close_db

Function close_db

examples/tutorial/flaskr/db.py:23–30  ·  view source on GitHub ↗

If this request connected to the database, close the connection.

(e=None)

Source from the content-addressed store, hash-verified

21
22
23def close_db(e=None):
24 """If this request connected to the database, close the
25 connection.
26 """
27 db = g.pop("db", None)
28
29 if db is not None:
30 db.close()
31
32
33def init_db():

Callers

nothing calls this directly

Calls 2

closeMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected