We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcb3261 commit dfca6cbCopy full SHA for dfca6cb
capture.go
@@ -161,7 +161,8 @@ func alert(exception error) error {
161
defer timer.Stop()
162
163
done := make(chan struct{})
164
- finish := sync.OnceFunc(func() {close(done)})
+ finish := func() {close(done)}
165
+ var once sync.Once
166
var mu sync.Mutex
167
168
// start a goroutine for each handler
@@ -185,7 +186,7 @@ func alert(exception error) error {
185
186
default:
187
e.id[provider] = id
188
if len(e.id) == len(capture) {
- finish()
189
+ once.Do(finish)
190
}
191
192
}()
@@ -197,8 +198,8 @@ waitLoop:
197
198
select {
199
case <- timer.C:
200
mu.Lock()
- defer mu.Unlock()
201
202
+ mu.Unlock()
203
case <- done:
204
break waitLoop
205
0 commit comments