Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit

Permalink
definindo o indice correto do time no ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonata-menezes committed Jun 11, 2017
1 parent 9b4f29a commit 669def6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/pontuacao_historico.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (p *PontuacaoHistorico) Get(atletaId int) {
res, err := request.Get(p.MountUrl(atletaId), 10)

if err != nil || res.StatusCode() != 200 {
log.Println("erro na requisicao de historico", atletaId, err)
//log.Println("erro na requisicao de historico", atletaId, err)
return
}

Expand Down
7 changes: 3 additions & 4 deletions ranking_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ func SortPontuados(times TimesRankingFormated) {
go func(){
for t := range ChannelAddTimeRanking {
atlRanking := []AtletaRanking{}
for id, _ := range t.Atletas {
atlRanking = append(atlRanking, AtletaRanking{id})
for _, a := range t.Atletas {
atlRanking = append(atlRanking, AtletaRanking{a.AtletaId})
}
newT := TimeRankingFormated{}
newT.TimeId = t.TimeCompleto.TimeId
Expand All @@ -141,8 +141,7 @@ func SortPontuados(times TimesRankingFormated) {
inicio := time.Now()
sort.Sort(times)
CacheRankingPontuados = times
log.Println("sort", time.Since(inicio))
log.Println("contando times no ranking", len(times))
log.Println("sort", time.Since(inicio), "contando times no ranking", len(times))

// outro array de times, porem a chave e o time_id
for k, t := range times {
Expand Down

0 comments on commit 669def6

Please sign in to comment.