use text for sql
This commit is contained in:
parent
e0d96ed837
commit
96a6304e82
|
@ -9,7 +9,7 @@ from spiffworkflow_backend.models.db import db
|
||||||
def try_to_connect(start_time: float) -> None:
|
def try_to_connect(start_time: float) -> None:
|
||||||
"""Try to connect."""
|
"""Try to connect."""
|
||||||
try:
|
try:
|
||||||
db.first_or_404("select 1") # type: ignore
|
db.first_or_404(text("select 1")) # type: ignore
|
||||||
except sqlalchemy.exc.DatabaseError as exception:
|
except sqlalchemy.exc.DatabaseError as exception:
|
||||||
if time.time() - start_time > 15:
|
if time.time() - start_time > 15:
|
||||||
raise exception
|
raise exception
|
||||||
|
|
Loading…
Reference in New Issue