Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

collectChecks may run the same checks more than once #12

@cristiangraz

Description

@cristiangraz

In setting up this library, I initially added a database check to both AddLivenessCheck and AddReadinessCheck. In looking at handlers.go, it looks like the ready handler will run both liveness and readiness checks. I didn't see this documented anywhere, so I assumed each only ran their own specific checks as added.

Would it be possible to either 1) document the behavior in the godoc and README, or 2) treat each as separate checks. Maybe expose a third more explicit method AddLivenessReadinessCheck() if someone wants to add to both.

If both checks are going to be combined, it might make sense to treat the name as a unique identifier and ensure the same check (which may be registered in both places) is not run more than once. Otherwise the ready checks may call (for example) db.PingContext() twice instead of once for a single /ready check from Kubernetes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions