From a9a86ad8648cd5d9d20847b13ee2a5bb5f2f46f8 Mon Sep 17 00:00:00 2001 From: astraw99 Date: Mon, 9 Aug 2021 10:48:53 +0800 Subject: [PATCH] unify worker num to workers Kubernetes-commit: e6df935fd30c56a8ece0da6152c60fc725d942b7 --- examples/workqueue/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/workqueue/main.go b/examples/workqueue/main.go index cb00a985..e854840a 100644 --- a/examples/workqueue/main.go +++ b/examples/workqueue/main.go @@ -116,7 +116,7 @@ func (c *Controller) handleErr(err error, key interface{}) { } // Run begins watching and syncing. -func (c *Controller) Run(threadiness int, stopCh chan struct{}) { +func (c *Controller) Run(workers int, stopCh chan struct{}) { defer runtime.HandleCrash() // Let the workers stop when we are done @@ -131,7 +131,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) { return } - for i := 0; i < threadiness; i++ { + for i := 0; i < workers; i++ { go wait.Until(c.runWorker, time.Second, stopCh) }