mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 09:50:20 +08:00
Use httpstatus code
This commit is contained in:
parent
d7bbb3280e
commit
ad83234e77
3
main.py
3
main.py
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
from http import HTTPStatus
|
||||||
|
|
||||||
import uvicorn.config
|
import uvicorn.config
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
@ -34,7 +35,7 @@ async def health_check():
|
|||||||
health_check_request = read_item(
|
health_check_request = read_item(
|
||||||
LinkRequest.model_construct(url="https://prowlarr.servarr.com/v1/ping")
|
LinkRequest.model_construct(url="https://prowlarr.servarr.com/v1/ping")
|
||||||
)
|
)
|
||||||
if health_check_request.solution.status != 200:
|
if health_check_request.solution.status != HTTPStatus.OK:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=500,
|
status_code=500,
|
||||||
detail="Health check failed",
|
detail="Health check failed",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user