Skip to content

Commit

Permalink
Fix error if no data in index
Browse files Browse the repository at this point in the history
  • Loading branch information
kompotkot committed Jul 11, 2024
1 parent 9748e39 commit 75633b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion indexer/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ func (p *PostgreSQLpgx) GetLatestDBBlockNumber(blockchain string) (uint64, error

err = conn.QueryRow(context.Background(), query).Scan(&blockNumber)
if err != nil {
return 0, fmt.Errorf("no data in %s, err: %w", blocksTableName, err)
log.Printf("No data found in %s table", blocksTableName)
return 0, err
}

return blockNumber, nil
Expand Down

0 comments on commit 75633b6

Please sign in to comment.