summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/quorum/quorum.go2
-rw-r--r--internal/quorum/quorum_test.go4
-rw-r--r--internal/server/server.go2
3 files changed, 4 insertions, 4 deletions
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
}