Skip to content

Commit 6c02343

Browse files
author
Evsyukov Denis
committed
refactor: improve cancellation function handling in monitor by checking existence before invocation
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
1 parent 6d18229 commit 6c02343

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/kube_events_manager/monitor.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ func (m *monitor) CreateInformers() error {
238238
return
239239
}
240240

241-
fn, _ := m.cancelForNs.Load(nsName)
242-
fn()
241+
if fn, ok := m.cancelForNs.Load(nsName); ok {
242+
fn()
243+
}
243244

244245
// TODO wait
245246

0 commit comments

Comments
 (0)