frontend: s/ctx.TODO/ctx.Background
This commit is contained in:
parent
6cd505269e
commit
093a748457
2 changed files with 8 additions and 8 deletions
|
@ -136,7 +136,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := t.logic.HandleAnnounce(context.TODO(), req)
|
resp, err := t.logic.HandleAnnounce(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteError(w, err)
|
WriteError(w, err)
|
||||||
return
|
return
|
||||||
|
@ -148,7 +148,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
|
||||||
return
|
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.
|
// 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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := t.logic.HandleScrape(context.TODO(), req)
|
resp, err := t.logic.HandleScrape(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteError(w, err)
|
WriteError(w, err)
|
||||||
return
|
return
|
||||||
|
@ -175,5 +175,5 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
go t.logic.AfterScrape(context.TODO(), req, resp)
|
go t.logic.AfterScrape(context.Background(), req, resp)
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp *bittorrent.AnnounceResponse
|
var resp *bittorrent.AnnounceResponse
|
||||||
resp, err = t.logic.HandleAnnounce(context.TODO(), req)
|
resp, err = t.logic.HandleAnnounce(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteError(w, txID, err)
|
WriteError(w, txID, err)
|
||||||
return
|
return
|
||||||
|
@ -211,7 +211,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
|
||||||
|
|
||||||
WriteAnnounce(w, txID, resp)
|
WriteAnnounce(w, txID, resp)
|
||||||
|
|
||||||
go t.logic.AfterAnnounce(context.TODO(), req, resp)
|
go t.logic.AfterAnnounce(context.Background(), req, resp)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp *bittorrent.ScrapeResponse
|
var resp *bittorrent.ScrapeResponse
|
||||||
resp, err = t.logic.HandleScrape(context.TODO(), req)
|
resp, err = t.logic.HandleScrape(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteError(w, txID, err)
|
WriteError(w, txID, err)
|
||||||
return
|
return
|
||||||
|
@ -234,7 +234,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
|
||||||
|
|
||||||
WriteScrape(w, txID, resp)
|
WriteScrape(w, txID, resp)
|
||||||
|
|
||||||
go t.logic.AfterScrape(context.TODO(), req, resp)
|
go t.logic.AfterScrape(context.Background(), req, resp)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue