import fastapi_healthcheck
app = FastAPI(...)
class WorkerChecker(healthcheck.base.Base):
def check(self):
status = False
# code that checks health
time_passed_for_check = 1.0
return {"name": self.name, "status": status, "optional": self.optional, "time": time_passed_for_check}
fastapi_healthcheck.add_health_route(app, name="Super-Resolution", checkers=[
healthcheck.redis.Checker(), #built-in checker
WorkerChecker(name="Worker Checker") #custom checker
])
-
Notifications
You must be signed in to change notification settings - Fork 3
License
flagman/fastapi-healthcheck
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published