|
|
|
@ -40,6 +40,7 @@ func (p *pool) size() int {
|
|
|
|
|
|
|
|
|
|
func (p *pool) startOneWorker(stoppedCh chan<- string) { |
|
|
|
|
worker := newWorker(p.host, p.runner, p.logger, p.state) |
|
|
|
|
fn := func(ctx context.Context) { worker.run(ctx, p.stopCh, stoppedCh) } |
|
|
|
|
|
|
|
|
|
p.workers[worker.id] = worker |
|
|
|
|
|
|
|
|
@ -47,12 +48,12 @@ func (p *pool) startOneWorker(stoppedCh chan<- string) {
|
|
|
|
|
p.zombie = zombie.GoWithContext( |
|
|
|
|
context.Background(), |
|
|
|
|
1, |
|
|
|
|
func(ctx context.Context) { worker.run(ctx, p.stopCh, stoppedCh) }, |
|
|
|
|
fn, |
|
|
|
|
zombie.WithName("worker"), |
|
|
|
|
zombie.WithLogger(p.logger), |
|
|
|
|
) |
|
|
|
|
} else { |
|
|
|
|
p.zombie.Go(1) |
|
|
|
|
p.zombie.Go(1, fn) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|