Skip to content

@check decorator breaks response without being wrapped #191

@mwarkentin

Description

@mwarkentin

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions