Commit c47bedaa authored by Quentin Smith's avatar Quentin Smith

analysis/appengine: use a 60s timeout when fetching query results

Change-Id: Id4d36e9da9839d85d37947b09303ec57121b6fb1
Reviewed-on: https://go-review.googlesource.com/35873Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent 1449119c
......@@ -9,7 +9,9 @@ import (
"log"
"net/http"
"os"
"time"
"golang.org/x/net/context"
"golang.org/x/perf/analysis/app"
"golang.org/x/perf/storage"
"google.golang.org/appengine"
......@@ -31,6 +33,11 @@ func mustGetenv(k string) string {
// write to.
func appHandler(w http.ResponseWriter, r *http.Request) {
ctx := appengine.NewContext(r)
// urlfetch defaults to 5s timeout if the context has no timeout.
// The underlying request has a 60 second timeout, so we might as well propagate that here.
// (Why doesn't appengine do that for us?)
ctx, cancel := context.WithTimeout(ctx, 60*time.Second)
defer cancel()
app := &app.App{
StorageClient: &storage.Client{
BaseURL: mustGetenv("STORAGE_URL_BASE"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment