mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 03:41:34 +00:00
Merge pull request #3728 from nspcc-dev/blockfetcher-close
Fix blockfetcher closing
This commit is contained in:
commit
a68856c27c
1 changed files with 3 additions and 3 deletions
|
@ -226,9 +226,8 @@ func newServerFromConstructors(config ServerConfig, chain Ledger, stSync StateSy
|
||||||
s.bSyncQueue = bqueue.New(s.stateSync, log, nil, bqueue.DefaultCacheSize, updateBlockQueueLenMetric, bqueue.NonBlocking)
|
s.bSyncQueue = bqueue.New(s.stateSync, log, nil, bqueue.DefaultCacheSize, updateBlockQueueLenMetric, bqueue.NonBlocking)
|
||||||
s.bFetcherQueue = bqueue.New(chain, log, nil, s.NeoFSBlockFetcherCfg.BQueueSize, updateBlockQueueLenMetric, bqueue.Blocking)
|
s.bFetcherQueue = bqueue.New(chain, log, nil, s.NeoFSBlockFetcherCfg.BQueueSize, updateBlockQueueLenMetric, bqueue.Blocking)
|
||||||
var err error
|
var err error
|
||||||
s.blockFetcher, err = blockfetcher.New(chain, s.NeoFSBlockFetcherCfg, log, s.bFetcherQueue.PutBlock, func() {
|
s.blockFetcher, err = blockfetcher.New(chain, s.NeoFSBlockFetcherCfg, log, s.bFetcherQueue.PutBlock,
|
||||||
close(s.blockFetcherFin)
|
sync.OnceFunc(func() { close(s.blockFetcherFin) }))
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create NeoFS BlockFetcher: %w", err)
|
return nil, fmt.Errorf("failed to create NeoFS BlockFetcher: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -575,6 +574,7 @@ func (s *Server) run() {
|
||||||
s.tryInitStateSync()
|
s.tryInitStateSync()
|
||||||
s.tryStartServices()
|
s.tryStartServices()
|
||||||
}
|
}
|
||||||
|
s.blockFetcherFin = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue