diff --git a/backend/cmd/misc/main.go b/backend/cmd/misc/main.go index d7f9fc7c49..082906619c 100644 --- a/backend/cmd/misc/main.go +++ b/backend/cmd/misc/main.go @@ -706,7 +706,6 @@ func fixEns(erigonClient *rpc.ErigonClient) error { log.Infof("processing batch %v-%v / %v", i, to, total) for _, addr := range batch { - addr := addr g.Go(func() error { ensAddr, err := go_ens.Resolve(erigonClient.GetNativeClient(), addr.EnsName) if err != nil { diff --git a/backend/cmd/rewards_exporter/main.go b/backend/cmd/rewards_exporter/main.go index 116f423064..74c781ffe0 100644 --- a/backend/cmd/rewards_exporter/main.go +++ b/backend/cmd/rewards_exporter/main.go @@ -148,7 +148,6 @@ func Run() { }() for _, e := range notExportedEpochs { - e := e g.Go(func() error { var err error for i := 0; i < 10; i++ { diff --git a/backend/pkg/api/handlers/search.go b/backend/pkg/api/handlers/search.go index 16521bd925..a800d8e45e 100644 --- a/backend/pkg/api/handlers/search.go +++ b/backend/pkg/api/handlers/search.go @@ -192,7 +192,6 @@ func (h *HandlerService) InternalPostSearch(w http.ResponseWriter, r *http.Reque continue } for _, chainId := range chainIdSet { - chainId := chainId searchType := searchType g.Go(func() error { searchResult, err := searchTypeMap[searchType].handlerFunc(ctx, h, req.Input, chainId) diff --git a/backend/pkg/blobindexer/blobindexer.go b/backend/pkg/blobindexer/blobindexer.go index 4d8885661b..d5a35715f8 100644 --- a/backend/pkg/blobindexer/blobindexer.go +++ b/backend/pkg/blobindexer/blobindexer.go @@ -476,7 +476,6 @@ func (bi *BlobIndexer) storeBlobsInS3(blobs []constypes.BlobSidecarsData) error g.SetLimit(4) for _, d := range blobs { - d := d g.Go(func() error { select { case <-gCtx.Done(): diff --git a/backend/pkg/commons/db/bigtable_eth1.go b/backend/pkg/commons/db/bigtable_eth1.go index 5e919f49cb..1e9cacc1f5 100644 --- a/backend/pkg/commons/db/bigtable_eth1.go +++ b/backend/pkg/commons/db/bigtable_eth1.go @@ -951,7 +951,6 @@ func (bigtable *Bigtable) GetAddressesNamesArMetadata(addresses *map[string]stri if inputMetadata != nil { for address := range *inputMetadata { - address := address g.Go(func() error { metadata, err := bigtable.GetERC20MetadataForAddress([]byte(address)) if err != nil { diff --git a/backend/pkg/commons/price/price.go b/backend/pkg/commons/price/price.go index 9218b2b6dc..54f57d20de 100644 --- a/backend/pkg/commons/price/price.go +++ b/backend/pkg/commons/price/price.go @@ -133,8 +133,6 @@ func Init(chainId uint64, eth1Endpoint, mainCurrencyParam, clCurrencyParam, elCu func updatePrices() { g := &errgroup.Group{} for pair, feed := range feeds { - pair := pair - feed := feed g.Go(func() error { price, err := getPriceFromFeed(feed) if err != nil { diff --git a/backend/pkg/commons/utils/utils_test.go b/backend/pkg/commons/utils/utils_test.go index 2a4dad58c4..d712d68c17 100644 --- a/backend/pkg/commons/utils/utils_test.go +++ b/backend/pkg/commons/utils/utils_test.go @@ -18,7 +18,6 @@ type sliceToMapTestCase[T comparable] struct { func runSliceToMapTests[T comparable](t *testing.T, testCases []sliceToMapTestCase[T]) { for _, tc := range testCases { // Capture tc to avoid issues with the loop variable in parallel tests. - tc := tc t.Run(tc.name, func(t *testing.T) { result := SliceToMap(tc.input) assert.True(t, maps.Equal(tc.expected, result)) diff --git a/backend/pkg/exporter/modules/base.go b/backend/pkg/exporter/modules/base.go index 5eff0e0c4b..01a68daab0 100644 --- a/backend/pkg/exporter/modules/base.go +++ b/backend/pkg/exporter/modules/base.go @@ -173,7 +173,6 @@ func startSubscriptionModules(moduleCtx *ModuleContext, modules []ModuleInterfac func notifyAllModules(goPool *errgroup.Group, modules []ModuleInterface, f func(ModuleInterface) error) { for _, module := range modules { - module := module goPool.Go(func() error { start := time.Now() r := services.StatusReporter.NewStatusReport(module.GetMonitoringEventId(), 5*time.Minute, constants.Default) diff --git a/backend/pkg/exporter/modules/dashboard_data_aggregate_backfills.go b/backend/pkg/exporter/modules/dashboard_data_aggregate_backfills.go index ba16f84524..90d5c94cf9 100644 --- a/backend/pkg/exporter/modules/dashboard_data_aggregate_backfills.go +++ b/backend/pkg/exporter/modules/dashboard_data_aggregate_backfills.go @@ -38,7 +38,6 @@ func (d *dashboardData) aggregateBackfillTask() { // fork for every backfill we have to do backfillType := backfillType for _, aggregateType := range aggregates { - aggregateType := aggregateType fields := log.Fields{ "backfillType": backfillType, "aggregateType": aggregateType, @@ -109,8 +108,6 @@ func (d *dashboardData) backfillAggregates(t edb.AggregateBackfillType, a edb.Ag eg := &errgroup.Group{} eg.SetLimit(int(utils.Config.DashboardExporter.AggregateBackfillsIncompleteInParallel)) for id, batch := range batches { - batch := batch - id := id eg.Go(func() (err error) { //d.log.InfoWithFields("doing backfill batch %s", id) d.log.InfoWithFields(log.Fields{"backfillType": t, "backfillBatchId": id, "timestampRange": []time.Time{batch[0].Timestamp, batch[len(batch)-1].Timestamp}}, "doing aggregate backfill batch") diff --git a/backend/pkg/exporter/modules/dashboard_data_backfills.go b/backend/pkg/exporter/modules/dashboard_data_backfills.go index a923a1ecdf..0d1ae080ec 100644 --- a/backend/pkg/exporter/modules/dashboard_data_backfills.go +++ b/backend/pkg/exporter/modules/dashboard_data_backfills.go @@ -26,7 +26,6 @@ func (d *dashboardData) backfillTask() { } for _, backfillType := range jobs { // fork for every backfill we have to do - backfillType := backfillType go func() { log.Tracef("starting backfill for %s", backfillType) for { @@ -89,8 +88,6 @@ func (d *dashboardData) backfillEpochs(t edb.BackfillType, epochs []edb.Backfill eg := &errgroup.Group{} eg.SetLimit(int(utils.Config.DashboardExporter.BackfillInParallel)) for id, epochs := range backfillBatchEpochs { - epochs := epochs - id := id eg.Go(func() (err error) { //d.log.InfoWithFields("doing backfill batch %s", id) d.log.InfoWithFields(log.Fields{"backfillType": t, "backfillBatchId": id, "epochRange": []uint64{epochs[0].Epoch, epochs[len(epochs)-1].Epoch}}, "doing backfill batch") diff --git a/backend/pkg/exporter/modules/dashboard_data_maintenance.go b/backend/pkg/exporter/modules/dashboard_data_maintenance.go index 2573a83f24..1a502dc003 100644 --- a/backend/pkg/exporter/modules/dashboard_data_maintenance.go +++ b/backend/pkg/exporter/modules/dashboard_data_maintenance.go @@ -110,8 +110,6 @@ func (d *dashboardData) transferEpochs(epochs []edb.EpochMetadata) error { eg := &errgroup.Group{} eg.SetLimit(int(utils.Config.DashboardExporter.TransferInParallel)) for id, epochs := range transferBatchEpochs { - epochs := epochs - id := id eg.Go(func() error { d.log.Infof("doing transfer batch %s", id) err := edb.TransferEpochs(epochs) diff --git a/backend/pkg/exporter/modules/dashboard_data_rollings.go b/backend/pkg/exporter/modules/dashboard_data_rollings.go index 4b3ea91162..ddeb416ec4 100644 --- a/backend/pkg/exporter/modules/dashboard_data_rollings.go +++ b/backend/pkg/exporter/modules/dashboard_data_rollings.go @@ -40,7 +40,6 @@ func (d *dashboardData) handleRollings() error { eg := errgroup.Group{} eg.SetLimit(int(utils.Config.DashboardExporter.RollingsInParallel)) for _, rolling := range rollings { - rolling := rolling eg.Go(func() error { return d.doRollingCheck(rolling) }) diff --git a/backend/pkg/monitoring/services/clickhouse_rollings.go b/backend/pkg/monitoring/services/clickhouse_rollings.go index 4964c9da17..a9a726a1fc 100644 --- a/backend/pkg/monitoring/services/clickhouse_rollings.go +++ b/backend/pkg/monitoring/services/clickhouse_rollings.go @@ -52,7 +52,6 @@ func (s *ServiceClickhouseRollings) runChecks() { } wg := sync.WaitGroup{} for rolling := range maps.Keys(rollings) { - rolling := rolling wg.Add(1) go func() { defer wg.Done() diff --git a/backend/pkg/notification/sending.go b/backend/pkg/notification/sending.go index f71de1ca03..0d4cce566c 100644 --- a/backend/pkg/notification/sending.go +++ b/backend/pkg/notification/sending.go @@ -275,7 +275,6 @@ func sendWebhookNotifications() error { g := &errgroup.Group{} g.SetLimit(50) // issue at most 50 requests at a time for _, n := range notificationQueueItem { - n := n _, _, err := db.IncrSentMessagesCount(NOTIFICAION_WEBHOOK_RATE_LIMIT_BUCKET, n.Content.UserId, 1, -1) if err != nil { log.Error(err, "error increasing sent webhook count", 0) @@ -392,7 +391,6 @@ func sendDiscordNotifications() error { g := &errgroup.Group{} g.SetLimit(50) // issue at most 50 requests at a time for _, n := range notificationQueueItem { - n := n _, _, err := db.IncrSentMessagesCount(NOTIFICAION_WEBHOOK_RATE_LIMIT_BUCKET, n.Content.UserId, 1, -1) if err != nil { log.Error(err, "error increasing sent discord count", 0)