Skip to content

Commit 70ee07d

Browse files
committed
changes from comments
1 parent 81f7606 commit 70ee07d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func Execute() {
3030
func init() {
3131
cobra.OnInitialize(initConfig)
3232

33-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./configs/config.yml)")
33+
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "optional config file path (defaults to env-only when unset)")
3434
rootCmd.AddCommand(committerCmd)
3535
rootCmd.AddCommand(backfillCmd)
3636
}

internal/backfill/backfill.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func RunBackfill() {
3636
metrics.BackfillEndBlock.WithLabelValues(indexerName, chainIdStr).Set(float64(endBlockNumber))
3737

3838
wg := sync.WaitGroup{}
39+
wg.Add(1)
3940
go saveBlockDataToS3(&wg)
4041
channelValidBlockData(startBlockNumber, endBlockNumber)
4142
wg.Wait()
@@ -66,8 +67,6 @@ func saveBlockDataToS3(wg *sync.WaitGroup) {
6667
panic(r)
6768
}
6869
}()
69-
70-
wg.Add(1)
7170
defer wg.Done()
7271

7372
for blockdata := range blockdataChannel {

internal/committer/poollatest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ func pollLatest() error {
2020

2121
for {
2222
latestBlock, err := libs.RpcClient.GetLatestBlockNumber(context.Background())
23-
24-
// Update latest block number metric
25-
metrics.CommitterLatestBlockNumber.WithLabelValues(indexerName, chainIdStr).Set(float64(latestBlock.Uint64()))
26-
2723
if err != nil {
2824
log.Warn().Err(err).Msg("Failed to get latest block number, retrying...")
2925
time.Sleep(250 * time.Millisecond)
3026
continue
3127
}
28+
// Update latest block number metric
29+
metrics.CommitterLatestBlockNumber.WithLabelValues(indexerName, chainIdStr).Set(float64(latestBlock.Uint64()))
30+
3231
if nextBlockNumber >= latestBlock.Uint64() {
3332
time.Sleep(250 * time.Millisecond)
3433
continue

0 commit comments

Comments
 (0)