From 37fdae0b2a78a80729c8d8bfa69835f554b00120 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 22 May 2023 00:41:59 +0300 Subject: CleanExpired -> Expire --- internal/quorum/quorum.go | 2 +- internal/quorum/quorum_test.go | 4 ++-- internal/server/server.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal') diff --git a/internal/quorum/quorum.go b/internal/quorum/quorum.go index b28e8a9..ea73cd0 100644 --- a/internal/quorum/quorum.go +++ b/internal/quorum/quorum.go @@ -57,7 +57,7 @@ func (q Quorum) Score(conf config.Config) (scores []Score) { return } -func (q Quorum) CleanExpired() { +func (q Quorum) Expire() { var expired []string for from, vote := range q { diff --git a/internal/quorum/quorum_test.go b/internal/quorum/quorum_test.go index 3a0f186..4a12d02 100644 --- a/internal/quorum/quorum_test.go +++ b/internal/quorum/quorum_test.go @@ -96,7 +96,7 @@ func TestTieScore(t *testing.T) { }) } -func TestCleanExpired(t *testing.T) { +func TestExpire(t *testing.T) { quo := make(Quorum) conf := config.Config{Participants: []string{"foo:1234", "bay:4321"}} @@ -112,7 +112,7 @@ func TestCleanExpired(t *testing.T) { t.Errorf("Expected to have two votes before expiry: %v", quo) } - quo.CleanExpired() + quo.Expire() if len(quo) != 1 { t.Errorf("Expected to have only one vote after expiry: %v", quo) } diff --git a/internal/server/server.go b/internal/server/server.go index be87773..088e36c 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -46,7 +46,7 @@ func run(ctx context.Context, conf config.Config) error { } log.Printf("The current leader node is %s", winner) case <-time.After(vote.Expiry): - quo.CleanExpired() + quo.Expire() case <-serverCtx.Done(): return } -- cgit v1.2.3