mirror of
https://github.com/rancher/steve.git
synced 2025-09-23 12:29:09 +00:00
Fix send to closed channel panic in watch (#817)
This commit is contained in:
@@ -399,6 +399,11 @@ func (l *ListOptionIndexer) Watch(ctx context.Context, opts WatchOptions, events
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
// We might have added a watcher but the transaction failed in
|
||||
// which case we still want to remove the watcher
|
||||
if key != nil {
|
||||
l.removeWatcher(key)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user