| Index: go/src/infra/tricium/service/workflow-launcher/handlers.go
|
| diff --git a/go/src/infra/tricium/service/workflow-launcher/handlers.go b/go/src/infra/tricium/service/workflow-launcher/handlers.go
|
| index 6be1d5f5c04b30e02cba033c74a1f71be06050fe..badb7398a846ec556fee6731d8af32ae021f0809 100644
|
| --- a/go/src/infra/tricium/service/workflow-launcher/handlers.go
|
| +++ b/go/src/infra/tricium/service/workflow-launcher/handlers.go
|
| @@ -6,11 +6,12 @@
|
| package handlers
|
|
|
| import (
|
| - "html/template"
|
| "net/http"
|
|
|
| "google.golang.org/appengine"
|
| "google.golang.org/appengine/taskqueue"
|
| +
|
| + "infra/tricium/service/common"
|
| )
|
|
|
| func init() {
|
| @@ -18,14 +19,12 @@ func init() {
|
| http.HandleFunc("/workflow-launcher/queue-handler", queueHandler)
|
| }
|
|
|
| -var basePage = template.Must(template.ParseFiles("templates/base.html"))
|
| -
|
| func statusPageHandler(w http.ResponseWriter, r *http.Request) {
|
| // TODO(emso): Add workflow launcher stats
|
| - data := map[string]interface{}{
|
| + d := map[string]interface{}{
|
| "Msg": "Status of the Workflow Launcher ...",
|
| }
|
| - basePage.Execute(w, data)
|
| + common.ShowBasePage(w, d)
|
| }
|
|
|
| func queueHandler(w http.ResponseWriter, r *http.Request) {
|
| @@ -35,8 +34,8 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
| // Enqueue workflow listener task
|
| t := taskqueue.NewPOSTTask("/workflow-listener/queue-handler", map[string][]string{"name": {"Workflow Launched"}})
|
| - if _, err := taskqueue.Add(ctx, t, "workflow-listener-queue"); err != nil {
|
| - http.Error(w, err.Error(), http.StatusInternalServerError)
|
| + if _, e := taskqueue.Add(ctx, t, "workflow-listener-queue"); e != nil {
|
| + http.Error(w, e.Error(), http.StatusInternalServerError)
|
| return
|
| }
|
| }
|
|
|