MCPcopy Create free account
hub / github.com/ethstorage/es-node / saveStatusLoop

Method saveStatusLoop

ethstorage/p2p/protocol/syncclient.go:440–454  ·  view source on GitHub ↗

saveStatusLoop marshals the remaining sync tasks into leveldb.

()

Source from the content-addressed store, hash-verified

438
439// saveStatusLoop marshals the remaining sync tasks into leveldb.
440func (s *SyncClient) saveStatusLoop() {
441 defer s.wg.Done()
442
443 ticker := time.NewTicker(5 * time.Minute)
444 defer ticker.Stop()
445 for {
446 select {
447 case <-ticker.C:
448 s.saveSyncStatus()
449 case <-s.resCtx.Done():
450 s.lg.Info("Stopped P2P sync client save status")
451 return
452 }
453 }
454}
455
456// cleanTasks removes kv range retrieval tasks that have already been completed.
457func (s *SyncClient) cleanTasks() {

Callers 1

StartMethod · 0.95

Calls 2

saveSyncStatusMethod · 0.95
StopMethod · 0.45

Tested by

no test coverage detected