From 4d43325df1fc79f1d9728538c1ab272bcd43b6b9 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Sat, 10 Feb 2024 12:50:35 -0500 Subject: [PATCH] Go style --- store/state.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/store/state.go b/store/state.go index f1625951..1dbc3ce3 100644 --- a/store/state.go +++ b/store/state.go @@ -18,27 +18,27 @@ import ( // IsStaleRead returns whether a read is stale. func IsStaleRead( - LeaderLastContact time.Time, - LastFSMUpdateTime time.Time, - LastAppendedAtTime time.Time, - FSMIndex uint64, - CommitIndex uint64, - Freshness int64, - MaxStale int64, + leaderlastContact time.Time, + lastFSMUpdateTime time.Time, + lastAppendedAtTime time.Time, + fsmIndex uint64, + commitIndex uint64, + freshness int64, + maxStale int64, ) bool { - if Freshness == 0 { + if freshness == 0 { return false } - if time.Since(LeaderLastContact).Nanoseconds() > Freshness { + if time.Since(leaderlastContact).Nanoseconds() > freshness { return true } - if MaxStale == 0 { + if maxStale == 0 { return false } - if FSMIndex == CommitIndex { + if fsmIndex == commitIndex { return false } - return LastFSMUpdateTime.Sub(LastAppendedAtTime).Nanoseconds() > MaxStale + return lastFSMUpdateTime.Sub(lastAppendedAtTime).Nanoseconds() > maxStale } // IsNewNode returns whether a node using raftDir would be a brand-new node.