mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Prevent repeated db connect calls
Only call database.connect() if database.is_closed() Prevents errors if _db_connect is triggered twice
This commit is contained in:
parent
7ad8b8298d
commit
7ddba4fc59
@ -47,7 +47,8 @@ def create_app(
|
||||
|
||||
@app.before_request
|
||||
def _db_connect():
|
||||
database.connect()
|
||||
if database.is_closed():
|
||||
database.connect()
|
||||
|
||||
@app.teardown_request
|
||||
def _db_close(exc):
|
||||
|
Loading…
Reference in New Issue
Block a user