Skip to content

Commit

Permalink
Specify the number of worker threads
Browse files Browse the repository at this point in the history
  • Loading branch information
caiweidong committed Nov 21, 2018
1 parent 515e1b4 commit 8359ab4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/csi-attacher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ import (
)

const (
// Number of worker threads
threads = 10

// Default timeout of short CSI calls like GetPluginInfo
csiTimeout = time.Second

Expand All @@ -59,6 +56,7 @@ var (
enableLeaderElection = flag.Bool("leader-election", false, "Enable leader election.")
leaderElectionNamespace = flag.String("leader-election-namespace", "", "Namespace where this attacher runs.")
leaderElectionIdentity = flag.String("leader-election-identity", "", "Unique idenity of this attcher. Typically name of the pod where the attacher runs.")
threads = flag.Int("threads", 10, "Number of worker threads.")
)

var (
Expand Down Expand Up @@ -171,7 +169,7 @@ func main() {
if csiFactory != nil {
csiFactory.Start(stopCh)
}
ctrl.Run(threads, stopCh)
ctrl.Run(*threads, stopCh)
}

if !*enableLeaderElection {
Expand Down

0 comments on commit 8359ab4

Please sign in to comment.