def get_healthcheck():
"""
Handles healthcheck GET
- Currently, this basically checks the server is alive
- """
- return "", 200
+ Currently, this checks:
+ 1. whether the a1 webserver is up (if it isn't, this won't even be called, so even entering this function confirms it is)
+ 2. checks whether the rmr thread is running and has completed a loop recently
+ TODO: make "seconds" to pass in a configurable parameter?
+ """
+ if a1rmr.healthcheck_rmr_thread():
+ return "", 200
+ return "rmr thread is unhealthy", 500
# Policy types