From a499e554b06afef2a82ac913552e2f031cb4b4f7 Mon Sep 17 00:00:00 2001 From: Mike <41407352+hunjixin@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:49:51 +0800 Subject: [PATCH] fix: correct worker number in log (#202) Co-authored-by: hunjixin <16705420332lee@gmai.com> --- pkg/resourceprovider/minerctl.go | 2 ++ pkg/resourceprovider/resourceprovider.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/resourceprovider/minerctl.go b/pkg/resourceprovider/minerctl.go index a6e7862a..40bfedc5 100644 --- a/pkg/resourceprovider/minerctl.go +++ b/pkg/resourceprovider/minerctl.go @@ -124,6 +124,8 @@ func (m *MinerController) miningWorkerController(ctx context.Context) { numworkers = DefaultWorkerNum() } + log.Info().Int("workernum", numworkers).Msg("Worker ready for mining") + resultCh := make(chan TaskResult, numworkers*2) //avoid lock worker if have much work to submit launchWorkers := func(powCfg ResourceProviderPowOptions) error { for i := 0; i < numworkers; i++ { diff --git a/pkg/resourceprovider/resourceprovider.go b/pkg/resourceprovider/resourceprovider.go index d854201e..4250ff7f 100644 --- a/pkg/resourceprovider/resourceprovider.go +++ b/pkg/resourceprovider/resourceprovider.go @@ -136,7 +136,7 @@ func (resourceProvider *ResourceProvider) StartMineLoop(ctx context.Context) err Msgf("Mine and submit successfully") } - log.Info().Msgf("Listen to new pow round signal, %d workers read to work", resourceProvider.options.Pow.NumWorkers) + log.Info().Msgf("Listen to new pow round signal") miner := NewMinerController(nodeId, resourceProvider.options.Pow, taskCh, submitWork) go miner.Start(ctx) return nil