enhancement: simplify ready and health check handler usage

This commit is contained in:
Florian Schade
2024-10-16 20:26:00 +02:00
parent 0ea4312668
commit 66ff86bd35
27 changed files with 207 additions and 82 deletions
+7 -1
View File
@@ -1,14 +1,16 @@
package command
import (
"errors"
"fmt"
"net/http"
"github.com/urfave/cli/v2"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/services/frontend/pkg/config"
"github.com/owncloud/ocis/v2/services/frontend/pkg/config/parser"
"github.com/owncloud/ocis/v2/services/frontend/pkg/logging"
"github.com/urfave/cli/v2"
)
// Health is the entrypoint for the health command.
@@ -30,6 +32,10 @@ func Health(cfg *config.Config) *cli.Command {
),
)
if resp.StatusCode != http.StatusOK {
err = errors.New("foo")
}
if err != nil {
logger.Fatal().
Err(err).