From e526c4935711834f3a6eac26cef70b2fdff4a7ed Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Thu, 22 Sep 2022 07:15:47 -0700 Subject: [PATCH] fix: run healtcheck only on leader (#42) --- actions/actions.go | 1 + main.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/actions.go b/actions/actions.go index 79abae7d..154e00fb 100644 --- a/actions/actions.go +++ b/actions/actions.go @@ -85,6 +85,7 @@ type service struct { } func (s *service) Run(ctx context.Context) { + s.healthCheck.Initializing() for { select { case <-time.After(s.cfg.PollWaitInterval): diff --git a/main.go b/main.go index 918079fd..e043feea 100644 --- a/main.go +++ b/main.go @@ -141,7 +141,6 @@ func run( } healthzAction := health.NewHealthzProvider(health.HealthzCfg{HealthyPollIntervalLimit: (actionsConfig.PollWaitInterval + actionsConfig.PollTimeout) * 2}, log) - healthzAction.Initializing() svc := actions.NewService( log, actionsConfig,