go-sundheit icon indicating copy to clipboard operation
go-sundheit copied to clipboard

Allow for one-shot cheks

Open MichaelMure opened this issue 5 years ago • 2 comments

Nice little package :-)

In my experience, it's fairly common to expose alongside the health check values some static information about the service, typically the version.

Problem is, the only way to expose those information with go-sundheit is to define a check which means having a ticker refreshing the value. A ticker is not a performance issue but it's still a bit silly. It would be nice if go-sundheit allowed to do that in a less hacky way.

MichaelMure avatar Oct 18 '19 10:10 MichaelMure

It could be as simple as allowing to set ExecutionPeriod to zero and not starting the ticker.

MichaelMure avatar Oct 18 '19 10:10 MichaelMure

@MichaelMure This is indeed a simple change, but I will make this change only if you think a one-shot check is valuable as a check.

I'm saying that cause think using a health checks library to expose static data feels like a mix of concerns

WDYT?

eranharel avatar Oct 23 '19 10:10 eranharel