Skip to content

Commit

Permalink
check lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Geapefurit committed Nov 9, 2023
1 parent 81ae669 commit 8d8ab3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 50 deletions.
8 changes: 1 addition & 7 deletions block-etl/pkg/chains/sol/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ func (e *SolIndexer) StartIndex(ctx context.Context) {
e.onIndex = true

// TODO: can be muilti goroutine
// go e.IndexTasks(ctx, taskBlockNum)
go func() {
for i := uint64(203773000); i < 203773100; i++ {
taskBlockNum <- i
}
}()

go e.IndexTasks(ctx, taskBlockNum)
go e.IndexBlock(ctx, taskBlockNum, indexBlockNum)
go e.IndexTransfer(ctx, indexBlockNum, outTransfers)
go e.IndexToken(ctx, outTransfers, outTransfer)
Expand Down
40 changes: 0 additions & 40 deletions main.go

This file was deleted.

8 changes: 5 additions & 3 deletions ranker/api/v1/token/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ func sortSroces(scores map[int64]float32) []*ScoreItem {
return topScores
}

// TODO:too long,will be rewrite
//nolint:all
func QueryAndCollectTokens(ctx context.Context, scores map[int64]float32, topN int) ([]*rankernpool.SearchToken, error) {
topScores := sortSroces(scores)
result := []*rankernpool.SearchToken{}
Expand Down Expand Up @@ -216,9 +218,9 @@ func QueryAndCollectTokens(ctx context.Context, scores map[int64]float32, topN i
infos = append(infos, info)
}

// sort.Slice(infos, func(i, j int) bool {
// return infos[i].Distance < infos[j].Distance
// })
sort.Slice(infos, func(i, j int) bool {
return infos[i].Distance < infos[j].Distance
})

// collection
for _, v := range infos {
Expand Down

0 comments on commit 8d8ab3e

Please sign in to comment.