We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 079e8a4 commit 1eeb529Copy full SHA for 1eeb529
2 files changed
.changelog/6444.trivial.md
go/common/workerpool/workerpool.go
@@ -81,7 +81,11 @@ func (p *Pool) Stop() {
81
close(p.stopCh)
82
})
83
84
- for range p.jobCh.Out() { //nolint:revive
+ for item := range p.jobCh.Out() { //nolint:revive
85
+ job := item.(*jobDescriptor)
86
+ if job.completeCh != nil {
87
+ close(job.completeCh)
88
+ }
89
// Clear the channel to close all go routines and prevent memory leaks.
90
}
91
@@ -92,7 +96,7 @@ func (p *Pool) Quit() <-chan struct{} {
92
96
93
97
94
98
// Submit adds a task to the pool's queue and returns a channel that will be closed
95
-// once the task is complete.
99
+// once the task is complete or the pool is stopped.
100
func (p *Pool) Submit(job func()) <-chan struct{} {
101
p.lock.Lock()
102
defer p.lock.Unlock()
0 commit comments