From 93742b51f5f76822657153cf1dc12b9affc7c57c Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Tue, 31 May 2022 13:59:16 +0100 Subject: [PATCH] remove workers from ui status on error --- cmd/ui/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/ui/main.go b/cmd/ui/main.go index 2e5df28..a4756b1 100644 --- a/cmd/ui/main.go +++ b/cmd/ui/main.go @@ -150,14 +150,15 @@ func handleDiscoveryAcks(ctx context.Context, addrs <-chan string) { stat, err := s.Client.Status(ctx, &pb.StatusRequest{}) if err != nil { - glog.Warning(err) + glog.Warningf("Removing %s: %s", s.Id, err) + status.Lock() + delete(status.status, s.Id) + status.Unlock() } glog.Infof("Status of %s: %+v", s.Id, stat) status.Lock() status.status[s.Id] = stat status.Unlock() - - // TODO: remove old worker } }