-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Is your feature request related to a problem? Please describe.
@check decorator only works when the check is wrapped by another function which provides the basic response dict ({"check": _decorated_func()}). It would be nice if @check supported being the top-level check function.
Describe the solution you'd like
I'd like to be able to define a custom check like this:
@check
def db_write_health_check():
raise Exception()
This decorator is used by the checks which watchman provides as well, so it will need to handle multiple cases:
- A "single" check like
emailandstorage - A "list" of checks like
databasesandcaches - Custom checks
The response structure of existing checks should not change (eg. databases should not be renamed to check_databases or similar).
Describe alternatives you've considered
Documentation and examples:
Additional context
- Example of what happens without a wrapper in Returns 200 when custom check raises Exception #188