Simple implementation of the health checker for the worker

This commit is contained in:
ErickSkrauch
2020-04-10 03:07:53 +03:00
parent db19fe62f2
commit 677f48ff3f
5 changed files with 85 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import (
"log"
"os"
"github.com/etherlabsio/healthcheck"
"github.com/mono83/slf/wd"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -51,6 +52,12 @@ var workerCmd = &cobra.Command{
Emitter: dispatcher,
UUIDsProvider: uuidsProvider,
}).CreateHandler()
handler.Handle("/healthcheck", healthcheck.Handler(
healthcheck.WithChecker(
"mojang-batch-uuids-provider-response",
eventsubscribers.MojangBatchUuidsProviderChecker(dispatcher),
),
)).Methods("GET")
finishChan := make(chan bool)
go func() {