Tu Nombre commited on
Commit
be5db62
·
1 Parent(s): 0d3e134

fix check space gradio

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -483,9 +483,9 @@ async def crear(request: Request):
483
  @app.get("/check-space")
484
  async def check_space(url: str = ""):
485
  try:
486
- async with httpx.AsyncClient(timeout=10) as client:
487
  r = await client.get(url)
488
- if r.status_code < 500:
489
  return {"ready": True}
490
  except:
491
  pass
 
483
  @app.get("/check-space")
484
  async def check_space(url: str = ""):
485
  try:
486
+ async with httpx.AsyncClient(timeout=10, follow_redirects=True) as client:
487
  r = await client.get(url)
488
+ if r.status_code == 200 and "gradio" in r.text.lower():
489
  return {"ready": True}
490
  except:
491
  pass