Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@check decorator breaks response without being wrapped #191

Open
mwarkentin opened this issue Nov 25, 2022 · 3 comments
Open

@check decorator breaks response without being wrapped #191

mwarkentin opened this issue Nov 25, 2022 · 3 comments

Comments

@mwarkentin
Copy link
Owner

mwarkentin commented Nov 25, 2022

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 email and storage
  • A "list" of checks like databases and caches
  • 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

@tisdall
Copy link
Contributor

tisdall commented Nov 29, 2022

I think what you want is here: #77 (comment)

@mwarkentin
Copy link
Owner Author

Thanks.. to 7 years ago you. 😳

@mwarkentin
Copy link
Owner Author

@kiarashazarnia if this is something you want to work on there might be something to build off of in the comment above. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants