@check decorator breaks response without being wrapped
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:
- #189
- #190
Additional context
- Example of what happens without a wrapper in #188
I think what you want is here: https://github.com/mwarkentin/django-watchman/issues/77#issuecomment-215179580
Thanks.. to 7 years ago you. 😳
@kiarashazarnia if this is something you want to work on there might be something to build off of in the comment above. :)