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.

Liveness check - database ping issue #16

@nostdm

Description

@nostdm

Hello,

I'm trying to make use of this library to implement some healthchecks in my application.

My liveness check consists of a database ping check like this:

health.AddLivenessCheck("database-ping", healthcheck.DatabasePingCheck(db, 2*time.Second))

But given that the database.Ping() returns an error only on the initial request (i.e. if the database goes down at some point, it will not return an error) the /live endpoint request returns 200 OK even if the database is down.

Are there any plans to fix this, perhaps by using database.Query("SELECT 1") instead of database.Ping()?

Thanks a lot.

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