mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
event target registration failures must be returned (#16700)
This commit is contained in:
parent
2bbf380262
commit
b21d3f9b82
@ -41,10 +41,11 @@ func (l *lazyInit) doSlow(f func() error) error {
|
||||
l.m.Lock()
|
||||
defer l.m.Unlock()
|
||||
if atomic.LoadUint32(&l.done) == 0 {
|
||||
if f() == nil {
|
||||
// Mark as done only when f() is successful
|
||||
atomic.StoreUint32(&l.done, 1)
|
||||
if err := f(); err != nil {
|
||||
return err
|
||||
}
|
||||
// Mark as done only when f() is successful
|
||||
atomic.StoreUint32(&l.done, 1)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user