Skip to content
GitLab
Explore
Sign in
"views/afis/templates/git@esc-md-git.unil.ch:ICNML/web.git" did not exist on "6ddd8c7c384ba0c1cd7b2e9b0d2dcac6042aed9a"
Commits on Source (1)
Remove the sql check in the ping function
· d6d3027f
Marco De Donno
authored
Sep 24, 2019
d6d3027f
Hide whitespace changes
Inline
Side-by-side
module.py
View file @
d6d3027f
...
...
@@ -217,15 +217,8 @@ def my_render_template( *args, **kwargs ):
def
ping
():
"""
Ping function to check if the web application is healthy.
This function need to check all important element of the web application, i.e. the flask app and the postgresql database.
If the application report a error 500, the healthcheck done by the container orchestrator will fail, hence re-scheduling the container as needed.
"""
if
not
config
.
db
.
check
():
config
.
db
.
connect
()
# Try to re-connect to the database to try to serve the requests before the rescheduling
return
abort
(
500
)
else
:
return
"
pong
"
return
"
pong
"
@app.route
(
baseurl
+
"
/version
"
)
def
version
():
...
...