Skip to content
Snippets Groups Projects
Commit 4286f394 authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Fix: Use OperationalError from flask_sqlalchemy. (Redmine issue: #6205)

parent ed1b8f23
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@ __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea
import copy
from flask import Flask
import flask_sqlalchemy
from sqlalchemy.exc import OperationalError
#
# Custom libraries
......@@ -50,7 +49,7 @@ class RetryingQuery(flask_sqlalchemy.orm.Query):
for _ in range(2):
try:
return super()._execute_and_instances(querycontext)
except OperationalError:
except flask_sqlalchemy.orm.exc.sa_exc.OperationalError:
self.session.close()
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment