discovery/sync_manager: break out IsGraphSynced check
This commit is contained in:
1 file changed
+8
-4
@@ -380,12 +380,16 @@ func (m *SyncManager) syncerHandler() {
|
|||||||
// Our HistoricalSyncTicker has ticked, so we'll randomly select
|
// Our HistoricalSyncTicker has ticked, so we'll randomly select
|
||||||
// a peer and force a historical sync with them.
|
// a peer and force a historical sync with them.
|
||||||
case <-m.cfg.HistoricalSyncTicker.Ticks():
|
case <-m.cfg.HistoricalSyncTicker.Ticks():
|
||||||
|
// If we don't have a syncer available we have nothing
|
||||||
|
// to do.
|
||||||
s := m.forceHistoricalSync()
|
s := m.forceHistoricalSync()
|
||||||
|
if s == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// If we don't have a syncer available or we've already
|
// If we've already completed a historical sync, we'll
|
||||||
// performed our initial historical sync, then we have
|
// skip setting the initial historical syncer.
|
||||||
// nothing left to do.
|
if m.IsGraphSynced() {
|
||||||
if s == nil || m.IsGraphSynced() {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user