th commited on
Commit
48de17a
·
1 Parent(s): 89b14f9

fix: use @app .get + @app .head pattern for warmup endpoint

Browse files

- Changed from @app .api_route to @app .get + @app .head decorators
- Matches pattern of working astrologybazi-api health endpoint
- Supports both GET and HEAD methods (UptimeRobot compatibility)

🦊 Generated with Sisi

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -425,13 +425,14 @@ def health_check():
425
  }
426
 
427
 
428
- @app.api_route("/warmup", methods=["GET", "POST"])
 
429
  def warmup():
430
  """
431
  预热端点 - 保持服务处于活跃状态
432
 
433
  Warmup endpoint for UptimeRobot - keeps the service active
434
- 支持GET和POST两种方法(避免405错误)
435
  """
436
  return {
437
  "status": "warm",
 
425
  }
426
 
427
 
428
+ @app.get("/warmup")
429
+ @app.head("/warmup")
430
  def warmup():
431
  """
432
  预热端点 - 保持服务处于活跃状态
433
 
434
  Warmup endpoint for UptimeRobot - keeps the service active
435
+ 支持GET和HEAD两种方法(和其他正常运行的API保持一致)
436
  """
437
  return {
438
  "status": "warm",