From a9b7ca86f0a6bccb72349ad6fac43ca72fa91571 Mon Sep 17 00:00:00 2001 From: benjamin <ben@elixxir.io> Date: Thu, 27 Oct 2022 14:41:30 -0700 Subject: [PATCH] fixed isready so the float doesnt go above 100 --- xxdk/cmix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xxdk/cmix.go b/xxdk/cmix.go index 8d4e8e4d9..aa8fb7683 100644 --- a/xxdk/cmix.go +++ b/xxdk/cmix.go @@ -484,8 +484,6 @@ func (c *Cmix) GetNodeRegistrationStatus() (int, int, error) { return numRegistered, len(nodes) - numStale, nil } - - // IsReady returns true if at least percentReady of node registrations has // completed. If not all have completed, then it returns false and howClose will // be a percent (0-1) of node registrations completed. @@ -502,6 +500,9 @@ func (c *Cmix) IsReady(percentReady float64) (isReady bool, howClose float64) { isReady = (float64(numReg) / float64(numNodes)) >= percentReady howClose = float64(numReg) / (float64(numNodes) * percentReady) + if howClose > 1 { + howClose = 1 + } return isReady, howClose } -- GitLab