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

Side by Side Diff: client/cmd/swarming/common.go

Issue 1149823004: Set GOMAXPROCS=runtime.NumCPU(). (Closed) Base URL: git@github.com:luci/luci-go@4_drop_tid
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « client/cmd/isolated/common.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "os" 9 "os"
10 "runtime"
10 11
11 "github.com/luci/luci-go/client/internal/common" 12 "github.com/luci/luci-go/client/internal/common"
12 "github.com/luci/luci-go/client/internal/lhttp" 13 "github.com/luci/luci-go/client/internal/lhttp"
13 "github.com/maruel/subcommands" 14 "github.com/maruel/subcommands"
14 ) 15 )
15 16
17 func init() {
18 runtime.GOMAXPROCS(runtime.NumCPU())
19 }
20
16 type commonFlags struct { 21 type commonFlags struct {
17 subcommands.CommandRunBase 22 subcommands.CommandRunBase
18 defaultFlags common.Flags 23 defaultFlags common.Flags
19 serverURL string 24 serverURL string
20 } 25 }
21 26
22 // Init initializes common flags. 27 // Init initializes common flags.
23 func (c *commonFlags) Init() { 28 func (c *commonFlags) Init() {
24 c.defaultFlags.Init(&c.Flags) 29 c.defaultFlags.Init(&c.Flags)
25 c.Flags.StringVar(&c.serverURL, "server", os.Getenv("SWARMING_SERVER"), "Server URL; required. Set $SWARMING_SERVER to set a default.") 30 c.Flags.StringVar(&c.serverURL, "server", os.Getenv("SWARMING_SERVER"), "Server URL; required. Set $SWARMING_SERVER to set a default.")
(...skipping 11 matching lines...) Expand all
37 if err != nil { 42 if err != nil {
38 return err 43 return err
39 } 44 }
40 c.serverURL = s 45 c.serverURL = s
41 return nil 46 return nil
42 } 47 }
43 48
44 func (c *commonFlags) Close() error { 49 func (c *commonFlags) Close() error {
45 return c.defaultFlags.Close() 50 return c.defaultFlags.Close()
46 } 51 }
OLDNEW
« no previous file with comments | « client/cmd/isolated/common.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698