yangzhitao commited on
Commit
fa763b7
·
1 Parent(s): 12e4e22

fix: update health check URL to use dynamic backend port from settings

Browse files

- Modified the health check request in app.py to utilize the BACKEND_PORT setting for improved configuration flexibility.

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -58,7 +58,7 @@ def check_backend_health() -> tuple[bool, str]:
58
  返回: (is_healthy, status_html)
59
  """
60
  try:
61
- response = requests.get("http://localhost:8000/api/v1/health/", timeout=2)
62
  if response.status_code == 200:
63
  data = response.json()
64
  if data.get("code") == 0:
 
58
  返回: (is_healthy, status_html)
59
  """
60
  try:
61
+ response = requests.get(f"http://localhost:{settings.BACKEND_PORT}/api/v1/health/", timeout=2)
62
  if response.status_code == 200:
63
  data = response.json()
64
  if data.get("code") == 0: