Skip to content

Commit df3291a

Browse files
author
SM_SAYEED
committed
service check added
1 parent ccfd787 commit df3291a

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

app.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,23 @@ def fix_uploads_uniqueness():
437437

438438
#########################################################
439439

440+
@app.route("/healthz")
441+
def healthz():
442+
# Must be super fast and always 200 so Fly can mark the machine healthy
443+
return "ok", 200
444+
445+
#########################################################
446+
447+
@app.route("/diag/routes")
448+
def diag_routes():
449+
# Lets you confirm which routes are actually registered in prod
450+
if not session.get("admin"):
451+
abort(403)
452+
rules = sorted([str(r) for r in app.url_map.iter_rules()])
453+
return jsonify({"routes": rules})
454+
455+
#########################################################
456+
440457
# -- View and import (admin only) --
441458
@app.route('/materials/<property_name>/<tab>', methods=['GET', 'POST'])
442459
def property_detail(property_name, tab):

fly.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# fly.toml app configuration file generated for patterns-matter on 2025-07-28T11:37:29+02:00
1+
# fly.toml app configuration file for patterns-matter on 2025-07-28T11:37:29+02:00
22
#
33
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4-
#
54

65
app = 'patterns-matter'
76
primary_region = 'ams'
87

9-
[checks]
10-
[checks.web]
11-
grace_period = "10s"
12-
interval = "15s"
13-
method = "get"
14-
path = "/"
8+
9+
[[http_service.checks]]
10+
method = "GET"
11+
path = "/healthz"
12+
interval = "10s"
1513
timeout = "2s"
16-
type = "http"
14+
grace_period = "30s"
1715

1816

1917
[http_service]

0 commit comments

Comments
 (0)