Purge peers that have not announced for twice the announce interval

This commit is contained in:
Justin Li
2014-07-16 19:38:51 -04:00
parent 7fe6dc3b4e
commit cd6204f13d
6 changed files with 97 additions and 4 deletions

View File

@@ -99,6 +99,13 @@ func Serve(cfg *config.Config) {
glog.Fatal("New: ", err)
}
go tracker.PurgeInactivePeers(
t.pool,
cfg.PurgeInactiveTorrents,
cfg.Announce.Duration*2,
cfg.Announce.Duration,
)
glog.V(0).Info("Starting on ", cfg.Addr)
graceful.Run(cfg.Addr, cfg.RequestTimeout.Duration, NewRouter(t, cfg))
}