Skip to content

Commit

Permalink
[pipeline] Releases time ticker when shrink goroutine exits
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyanliu authored and Jack47 committed Dec 12, 2017
1 parent 2cf6124 commit 2c9c95d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/engine/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,12 @@ func (scheduler *dynamicPipelineScheduler) spawn() {
}

func (scheduler *dynamicPipelineScheduler) shrink() {
ticker := time.NewTicker(time.Second)
defer ticker.Stop()

for {
select {
case <-time.Tick(time.Second):
case <-ticker.C:
scheduler.instancesLock.RLock()

currentParallelism := uint32(len(scheduler.instances))
Expand Down

0 comments on commit 2c9c95d

Please sign in to comment.