@ -379,11 +379,13 @@ func AddBucketListenerConfig(bucket string, lcfg *listenerConfig, objAPI ObjectL
// Release lock after notifying peers
// Release lock after notifying peers
defer nsMutex . Unlock ( bucket , "" , opsID )
defer nsMutex . Unlock ( bucket , "" , opsID )
// update persistent config
// update persistent config if dist XL
err := persistListenerConfig ( bucket , listenerCfgs , objAPI )
if globalS3Peers . isDistXL {
if err != nil {
err := persistListenerConfig ( bucket , listenerCfgs , objAPI )
errorIf ( err , "Error persisting listener config when adding a listener." )
if err != nil {
return err
errorIf ( err , "Error persisting listener config when adding a listener." )
return err
}
}
}
// persistence success - now update in-memory globals on all
// persistence success - now update in-memory globals on all
@ -419,11 +421,13 @@ func RemoveBucketListenerConfig(bucket string, lcfg *listenerConfig, objAPI Obje
// Release lock after notifying peers
// Release lock after notifying peers
defer nsMutex . Unlock ( bucket , "" , opsID )
defer nsMutex . Unlock ( bucket , "" , opsID )
// update persistent config
// update persistent config if dist XL
err := persistListenerConfig ( bucket , updatedLcfgs , objAPI )
if globalS3Peers . isDistXL {
if err != nil {
err := persistListenerConfig ( bucket , updatedLcfgs , objAPI )
errorIf ( err , "Error persisting listener config when removing a listener." )
if err != nil {
return
errorIf ( err , "Error persisting listener config when removing a listener." )
return
}
}
}
// persistence success - now update in-memory globals on all
// persistence success - now update in-memory globals on all