mirror of https://github.com/minio/minio.git
Retry peer notification of events (#8621)
This commit is contained in:
parent
3c30e4503d
commit
3b67f629a4
|
@ -294,6 +294,21 @@ func (client *peerRESTClient) ListenBucketNotification(bucket string, eventNames
|
|||
|
||||
// SendEvent - calls send event RPC.
|
||||
func (client *peerRESTClient) SendEvent(bucket string, targetID, remoteTargetID event.TargetID, eventData event.Event) error {
|
||||
numTries := 10
|
||||
for {
|
||||
err := client.sendEvent(bucket, targetID, remoteTargetID, eventData)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if numTries == 0 {
|
||||
return err
|
||||
}
|
||||
numTries--
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
func (client *peerRESTClient) sendEvent(bucket string, targetID, remoteTargetID event.TargetID, eventData event.Event) error {
|
||||
args := sendEventRequest{
|
||||
TargetID: remoteTargetID,
|
||||
Event: eventData,
|
||||
|
|
Loading…
Reference in New Issue