Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: milo/appengine/swarming/html.go

Issue 2801463002: Milo: Use custom config caching layer (Closed)
Patch Set: Review: Remove double logging Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/frontend/templates/pages/frontpage.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/swarming/html.go
diff --git a/milo/appengine/swarming/html.go b/milo/appengine/swarming/html.go
index 4458d232d7214592f5cef66a8a86009933c954e5..17269e922eb21e5e9c1e256033229c8454472d6b 100644
--- a/milo/appengine/swarming/html.go
+++ b/milo/appengine/swarming/html.go
@@ -19,30 +19,21 @@ import (
"github.com/luci/luci-go/server/templates"
)
-const (
- defaultSwarmingServer = "chromium-swarm.appspot.com"
- defaultSwarmingDevServer = "chromium-swarm-dev.appspot.com"
-)
-
var errUnrecognizedHost = errors.New("Unregistered Swarming Host")
// getSwarmingHost parses the swarming hostname out of the context. If
// none is specified, get the default swarming host out of the global
// configs.
func getSwarmingHost(c context.Context, r *http.Request) (string, error) {
- settings, err := common.GetSettings(c)
- if err != nil {
- logging.WithError(err).Errorf(c, "could not get settings")
- return "", err
- }
+ settings := common.GetSettings(c)
if settings.Swarming == nil {
- err = errors.New("swarming not in settings")
+ err := errors.New("swarming not in settings")
logging.Errorf(c, err.Error())
return "", err
}
server := r.FormValue("server")
// If server isn't specified, return the default host.
- if server == "" {
+ if server == "" || server == settings.Swarming.DefaultHost {
return settings.Swarming.DefaultHost, nil
}
// If it is specified, validate the hostname.
« no previous file with comments | « milo/appengine/frontend/templates/pages/frontpage.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698