Skip to content

Commit 83c3583

Browse files
committed
cleanup
1 parent ab841a9 commit 83c3583

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cmd/geth/usage.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
242242
utils.StateDiffDBNodeIDFlag,
243243
utils.StateDiffDBClientNameFlag,
244244
utils.StateDiffWritingFlag,
245+
utils.StateDiffWorkersFlag,
245246
},
246247
},
247248
{

statediff/service.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ func (sds *Service) writeLoopWorker(params workerParams) {
276276
// TODO: how to handle with concurrent workers
277277
statediffMetrics.lastStatediffHeight.Update(int64(currentBlock.Number().Uint64()))
278278
case err := <-params.errCh:
279-
log.Warn("Error from chain event subscription", "error", err)
279+
log.Warn("Error from chain event subscription", "error", err, "worker", params.id)
280280
sds.close()
281281
return
282282
case <-sds.QuitChan:
283-
log.Info("Quitting the statediff writing process")
283+
log.Info("Quitting the statediff writing process", "worker", params.id)
284284
sds.close()
285285
return
286286
}
@@ -480,11 +480,8 @@ func (sds *Service) Unsubscribe(id rpc.ID) error {
480480
func (sds *Service) Start() error {
481481
log.Info("Starting statediff service")
482482

483-
{
484-
// TODO: also use worker pool here?
485-
chainEventCh := make(chan core.ChainEvent, chainEventChanSize)
486-
go sds.Loop(chainEventCh)
487-
}
483+
chainEventCh := make(chan core.ChainEvent, chainEventChanSize)
484+
go sds.Loop(chainEventCh)
488485

489486
if sds.enableWriteLoop {
490487
log.Info("Starting statediff DB write loop", "params", writeLoopParams)

0 commit comments

Comments
 (0)