Skip to content
Commits on Source (1)
...@@ -217,15 +217,8 @@ def my_render_template( *args, **kwargs ): ...@@ -217,15 +217,8 @@ def my_render_template( *args, **kwargs ):
def ping(): def ping():
""" """
Ping function to check if the web application is healthy. 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(): return "pong"
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"
@app.route( baseurl + "/version" ) @app.route( baseurl + "/version" )
def version(): def version():
......