File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,19 @@ func (s *jobScheduler) Schedule() {
91
91
continue
92
92
}
93
93
94
- select {
95
- case <- s .cancel :
96
- return
97
- case <- time .After (s .backoff .Duration ()):
98
- }
99
94
}
100
95
101
96
if ErrJobSource .Is (err ) {
102
97
close (s .jobs )
103
98
return
104
99
}
105
100
101
+ select {
102
+ case <- s .cancel :
103
+ return
104
+ case <- time .After (s .backoff .Duration ()):
105
+ }
106
+
106
107
continue
107
108
}
108
109
Original file line number Diff line number Diff line change @@ -106,12 +106,8 @@ func (wp *WorkerPool) remove(n int) {
106
106
wg .Wait ()
107
107
}
108
108
109
- // Wait waits for the workers to finish. A worker will finish when the queue to
110
- // retrieve jobs from is closed.
109
+ // Wait waits for the workers to finish.
111
110
func (wp * WorkerPool ) Wait () {
112
- <- wp .resize
113
- defer func () { wp .resize <- struct {}{} }()
114
-
115
111
wp .wg .Wait ()
116
112
wp .workers = nil
117
113
wp .opts .Metrics .Stop (false )
You can’t perform that action at this time.
0 commit comments