frontend: s/ctx.TODO/ctx.Background

This commit is contained in:
Jimmy Zelinskie 2016-09-05 12:25:11 -04:00
parent 6cd505269e
commit 093a748457
2 changed files with 8 additions and 8 deletions

View file

@ -136,7 +136,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
return
}
resp, err := t.logic.HandleAnnounce(context.TODO(), req)
resp, err := t.logic.HandleAnnounce(context.Background(), req)
if err != nil {
WriteError(w, err)
return
@ -148,7 +148,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
return
}
go t.logic.AfterAnnounce(context.TODO(), req, resp)
go t.logic.AfterAnnounce(context.Background(), req, resp)
}
// scrapeRoute parses and responds to a Scrape by using t.TrackerLogic.
@ -163,7 +163,7 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou
return
}
resp, err := t.logic.HandleScrape(context.TODO(), req)
resp, err := t.logic.HandleScrape(context.Background(), req)
if err != nil {
WriteError(w, err)
return
@ -175,5 +175,5 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou
return
}
go t.logic.AfterScrape(context.TODO(), req, resp)
go t.logic.AfterScrape(context.Background(), req, resp)
}

View file

@ -203,7 +203,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
}
var resp *bittorrent.AnnounceResponse
resp, err = t.logic.HandleAnnounce(context.TODO(), req)
resp, err = t.logic.HandleAnnounce(context.Background(), req)
if err != nil {
WriteError(w, txID, err)
return
@ -211,7 +211,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
WriteAnnounce(w, txID, resp)
go t.logic.AfterAnnounce(context.TODO(), req, resp)
go t.logic.AfterAnnounce(context.Background(), req, resp)
return
@ -226,7 +226,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
}
var resp *bittorrent.ScrapeResponse
resp, err = t.logic.HandleScrape(context.TODO(), req)
resp, err = t.logic.HandleScrape(context.Background(), req)
if err != nil {
WriteError(w, txID, err)
return
@ -234,7 +234,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
WriteScrape(w, txID, resp)
go t.logic.AfterScrape(context.TODO(), req, resp)
go t.logic.AfterScrape(context.Background(), req, resp)
return