Skip to content

flagman/fastapi-healthcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Healthcheck package

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
])

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages