mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -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()
|
l.m.Lock()
|
||||||
defer l.m.Unlock()
|
defer l.m.Unlock()
|
||||||
if atomic.LoadUint32(&l.done) == 0 {
|
if atomic.LoadUint32(&l.done) == 0 {
|
||||||
if f() == nil {
|
if err := f(); err != nil {
|
||||||
// Mark as done only when f() is successful
|
return err
|
||||||
atomic.StoreUint32(&l.done, 1)
|
|
||||||
}
|
}
|
||||||
|
// Mark as done only when f() is successful
|
||||||
|
atomic.StoreUint32(&l.done, 1)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user