| Index: appengine/cmd/dm/distributor/tq_handler.go
|
| diff --git a/appengine/cmd/dm/distributor/tq_handler.go b/appengine/cmd/dm/distributor/tq_handler.go
|
| index 218f1eb23dbdb5e4a8cbbfcd787eddbcb2695247..631dcde1ced11211c265b6bafee208d8ba0e84df 100644
|
| --- a/appengine/cmd/dm/distributor/tq_handler.go
|
| +++ b/appengine/cmd/dm/distributor/tq_handler.go
|
| @@ -2,38 +2,38 @@
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| package distributor
|
|
|
| import (
|
| "net/http"
|
| "net/url"
|
| "strings"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| "github.com/luci/luci-go/appengine/tumble"
|
| "github.com/luci/luci-go/common/logging"
|
| - "golang.org/x/net/context"
|
| + "github.com/luci/luci-go/server/router"
|
| )
|
|
|
| const handlerPattern = "/tq/distributor/:cfgName"
|
|
|
| func handlerPath(cfgName string) string {
|
| return strings.Replace(handlerPattern, ":cfgName", url.QueryEscape(cfgName), 1)
|
| }
|
|
|
| // TaskQueueHandler is the http handler that routes taskqueue tasks made with
|
| // Config.EnqueueTask to a distributor's HandleTaskQueueTask method.
|
| //
|
| -// This requires that c already have a Registry installed via the WithRegistry
|
| -// method.
|
| -func TaskQueueHandler(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
| +// This requires that ctx.Context already have a Registry installed via the
|
| +// WithRegistry method.
|
| +func TaskQueueHandler(ctx *router.Context) {
|
| + c, rw, r, p := ctx.Context, ctx.Writer, ctx.Request, ctx.Params
|
| defer r.Body.Close()
|
|
|
| cfgName := p.ByName("cfgName")
|
| dist, _, err := GetRegistry(c).MakeDistributor(c, cfgName)
|
| if err != nil {
|
| logging.Fields{"error": err, "cfg": cfgName}.Errorf(c, "Failed to make distributor")
|
| http.Error(rw, "bad distributor", http.StatusBadRequest)
|
| return
|
| }
|
| notifications, err := dist.HandleTaskQueueTask(r)
|
|
|