diff options
| author | Paul Buetow <paul@buetow.org> | 2023-10-21 12:47:46 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-10-21 12:47:46 +0300 |
| commit | 61919768cfe4df8fbd709e8e6034f4c4c83def27 (patch) | |
| tree | 17e69ec1a57aee73eb7300bf0bc9353ec29a9969 /internal/quorum | |
| parent | 8af37a343946ee904b421cb6353ea294e31804df (diff) | |
make score file and winner file names configurable.
Diffstat (limited to 'internal/quorum')
| -rw-r--r-- | internal/quorum/quorum.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/quorum/quorum.go b/internal/quorum/quorum.go index b29b428..9bce682 100644 --- a/internal/quorum/quorum.go +++ b/internal/quorum/quorum.go @@ -185,11 +185,11 @@ func (quo *Quorum) persist(changed bool) error { return err } - return writeFileViaTmp(fmt.Sprintf("%s/scores", quo.conf.StateDir), scoresStr) + return writeFileViaTmp(fmt.Sprintf("%s/%s", quo.conf.StateDir, quo.conf.ScoreFile), scoresStr) } func (quo *Quorum) persistWinner(winnerStr string) error { - winnerFile := fmt.Sprintf("%s/is_winner", quo.conf.StateDir) + winnerFile := fmt.Sprintf("%s/%s", quo.conf.StateDir, quo.conf.WinnerFile) if winnerStr == "" { if _, err := os.Stat(winnerFile); err != nil { return os.Remove(winnerFile) |
