mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-02-21 08:12:59 +08:00
unify worker num to workers
Kubernetes-commit: e6df935fd30c56a8ece0da6152c60fc725d942b7
This commit is contained in:
parent
6e98cc2cc7
commit
0bf5b5ab8f
@ -148,7 +148,7 @@ func NewController(
|
||||
// as syncing informer caches and starting workers. It will block until stopCh
|
||||
// is closed, at which point it will shutdown the workqueue and wait for
|
||||
// workers to finish processing their current work items.
|
||||
func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
|
||||
func (c *Controller) Run(workers int, stopCh <-chan struct{}) error {
|
||||
defer utilruntime.HandleCrash()
|
||||
defer c.workqueue.ShutDown()
|
||||
|
||||
@ -163,7 +163,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
|
||||
|
||||
klog.Info("Starting workers")
|
||||
// Launch two workers to process Foo resources
|
||||
for i := 0; i < threadiness; i++ {
|
||||
for i := 0; i < workers; i++ {
|
||||
go wait.Until(c.runWorker, time.Second, stopCh)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user