cleanup
This commit is contained in:
parent
ab841a9abe
commit
83c3583355
@ -242,6 +242,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
|
||||
utils.StateDiffDBNodeIDFlag,
|
||||
utils.StateDiffDBClientNameFlag,
|
||||
utils.StateDiffWritingFlag,
|
||||
utils.StateDiffWorkersFlag,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -276,11 +276,11 @@ func (sds *Service) writeLoopWorker(params workerParams) {
|
||||
// TODO: how to handle with concurrent workers
|
||||
statediffMetrics.lastStatediffHeight.Update(int64(currentBlock.Number().Uint64()))
|
||||
case err := <-params.errCh:
|
||||
log.Warn("Error from chain event subscription", "error", err)
|
||||
log.Warn("Error from chain event subscription", "error", err, "worker", params.id)
|
||||
sds.close()
|
||||
return
|
||||
case <-sds.QuitChan:
|
||||
log.Info("Quitting the statediff writing process")
|
||||
log.Info("Quitting the statediff writing process", "worker", params.id)
|
||||
sds.close()
|
||||
return
|
||||
}
|
||||
@ -480,11 +480,8 @@ func (sds *Service) Unsubscribe(id rpc.ID) error {
|
||||
func (sds *Service) Start() error {
|
||||
log.Info("Starting statediff service")
|
||||
|
||||
{
|
||||
// TODO: also use worker pool here?
|
||||
chainEventCh := make(chan core.ChainEvent, chainEventChanSize)
|
||||
go sds.Loop(chainEventCh)
|
||||
}
|
||||
chainEventCh := make(chan core.ChainEvent, chainEventChanSize)
|
||||
go sds.Loop(chainEventCh)
|
||||
|
||||
if sds.enableWriteLoop {
|
||||
log.Info("Starting statediff DB write loop", "params", writeLoopParams)
|
||||
|
Loading…
Reference in New Issue
Block a user