Skip to content

Commit

Permalink
healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Jun 20, 2024
1 parent 2272165 commit 5061bc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions horde/apis/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2644,13 +2644,17 @@ class Heartbeat(Resource):
def get(self):
"""If this loads, this node is available
Includes some other metrics to gauge the health of this node"""
db_conn = True
health = 'OK'
db_conn = True
try:
db.session.execute(text("SELECT 1"))
except Exception:
db_conn = False
health = 'DOWN'
if waitress_metrics.queue > 0:
health = 'OVERLOADED'
return {
"message": "OK",
"message": health,
"version": HORDE_VERSION,
"queue": waitress_metrics.queue,
"threads": waitress_metrics.threads,
Expand Down
2 changes: 1 addition & 1 deletion horde/consts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HORDE_VERSION = "4.38.0"
HORDE_VERSION = "4.38.1"

WHITELISTED_SERVICE_IPS = {
"212.227.227.178", # Turing Bot
Expand Down

0 comments on commit 5061bc9

Please sign in to comment.