Skip to content

Commit

Permalink
tracker total score
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Mar 11, 2024
1 parent c7536f8 commit a2b8477
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,17 @@ func (tm *TorrentManager) updateGlobalTrackers() error {
//return nil
}

var total uint64

if global := tm.worm.BestTrackers(); len(global) > 0 {
tm.globalTrackers = [][]string{global}
log.Info("Global trackers update", "size", len(global), "cap", wormhole.CAP, "health", float32(len(global))/float32(wormhole.CAP))

for _, url := range global {
score, _ := tm.wormScore(url)
log.Info("Tracker status", "url", url, "score", score)
total += score
}
log.Info("Global trackers update", "size", len(global), "cap", wormhole.CAP, "health", float32(len(global))/float32(wormhole.CAP), "total", total)
} else {
// TODO
return errors.New("best trackers failed")
Expand Down

0 comments on commit a2b8477

Please sign in to comment.