Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit eda5681

Browse files
committed
Fix sync status
1 parent 973fe1e commit eda5681

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ func (s *SyncManager) updateSyncStatus() (changed bool) {
272272
s.isSyncedLock.Lock()
273273
defer s.isSyncedLock.Unlock()
274274

275-
isSynced := s.IsBootstrapped() && time.Since(s.engine.Clock.Accepted().RelativeTime()) < s.optsSyncThreshold
275+
snapshot := s.engine.Clock.Snapshot()
276+
isSynced := s.IsBootstrapped() && ((snapshot.RelativeAcceptedTime.Sub(snapshot.AcceptedTime)) < s.optsSyncThreshold)
276277
if s.isSynced != isSynced {
277278
s.isSynced = isSynced
278279

0 commit comments

Comments
 (0)