mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-28 10:08:11 -07:00
First step towards removing Tracker Driver.
This feature isn't worth maintaining and if anyone needs to scale beyond memory on a single box, we can evaluate it then.
This commit is contained in:
+2
-9
@@ -9,22 +9,15 @@ import "github.com/chihaya/chihaya/tracker/models"
|
||||
// HandleScrape encapsulates all the logic of handling a BitTorrent client's
|
||||
// scrape without being coupled to any transport protocol.
|
||||
func (tkr *Tracker) HandleScrape(scrape *models.Scrape, w Writer) (err error) {
|
||||
conn, err := tkr.Pool.Get()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
if tkr.cfg.PrivateEnabled {
|
||||
if _, err = conn.FindUser(scrape.Passkey); err != nil {
|
||||
if _, err = tkr.FindUser(scrape.Passkey); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
var torrents []*models.Torrent
|
||||
for _, infohash := range scrape.Infohashes {
|
||||
torrent, err := conn.FindTorrent(infohash)
|
||||
torrent, err := tkr.FindTorrent(infohash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user