mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
api: Notify events only if bucket notifications are set. (#2293)
While the existing code worked, it went to an entire cycle of constructing event structure and end up not sending it. Avoid this in the first place, but returning quickly if notifications are not set on the bucket.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
3054b74260
commit
77248bd6e8
@@ -39,7 +39,7 @@ func (api objectAPIHandlers) loadNotificationConfig(bucket string) (nConfig noti
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case ObjectNotFound:
|
||||
return notificationConfig{}, nil
|
||||
return notificationConfig{}, errNoSuchNotifications
|
||||
}
|
||||
return notificationConfig{}, err
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func (api objectAPIHandlers) loadNotificationConfig(bucket string) (nConfig noti
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case ObjectNotFound:
|
||||
return notificationConfig{}, nil
|
||||
return notificationConfig{}, errNoSuchNotifications
|
||||
}
|
||||
return notificationConfig{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user