mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03: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
@@ -16,7 +16,10 @@
|
||||
|
||||
package main
|
||||
|
||||
import "encoding/xml"
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Represents the criteria for the filter rule.
|
||||
type filterRule struct {
|
||||
@@ -68,6 +71,9 @@ type notificationConfig struct {
|
||||
LambdaConfigurations []lambdaFuncConfig `xml:"CloudFunctionConfiguration"`
|
||||
}
|
||||
|
||||
// Internal error used to signal notifications not set.
|
||||
var errNoSuchNotifications = errors.New("The specified bucket does not have bucket notifications")
|
||||
|
||||
// EventName is AWS S3 event type:
|
||||
// http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html
|
||||
type EventName int
|
||||
|
||||
Reference in New Issue
Block a user