Skip to content

Commit

Permalink
(NOBIDS) eth1indexer: move ens-importing its own go-routine
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Aug 9, 2024
1 parent 2d57933 commit d0c1ed6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions cmd/eth1indexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,21 +378,26 @@ func main() {
ProcessMetadataUpdates(bt, client, balanceUpdaterPrefix, *balanceUpdaterBatchSize, 10)
}

if *enableEnsUpdater {
err := bt.ImportEnsUpdates(client.GetNativeClient(), *ensBatchSize)
if err != nil {
utils.LogError(err, "error importing ens updates", 0, nil)
continue
}
}

logrus.Infof("index run completed")
services.ReportStatus("eth1indexer", "Running", nil)
}

// utils.WaitForCtrlC()
}

func ImportEnsUpdatesLoop(bt *db.Bigtable, client *rpc.ErigonClient, batchSize int64) {
time.Sleep(time.Second * 5)
for {
err := bt.ImportEnsUpdates(client.GetNativeClient(), batchSize)
if err != nil {
logrus.WithError(err).Errorf("error importing ens updates")
} else {
services.ReportStatus("ensIndexer", "Running", nil)
}
time.Sleep(time.Second * 5)
}
}

func UpdateTokenPrices(bt *db.Bigtable, client *rpc.ErigonClient, tokenListPath string) error {

tokenListContent, err := os.ReadFile(tokenListPath)
Expand Down

0 comments on commit d0c1ed6

Please sign in to comment.