delete rules by its name without deserializing

This commit is contained in:
Gustavo Iñiguez Goia 2020-05-30 01:44:22 +02:00
parent 6bbf3b33be
commit 558e511718

View file

@ -102,13 +102,8 @@ func (c *Client) handleNotification(stream protocol.UI_NotificationsClient, noti
var rErr error
for _, rul := range notification.Rules {
log.Info("[notification] delete rule: ", rul.Name, notification.Id)
r := rule.Deserialize(rul)
if r == nil {
rErr = fmt.Errorf("Invalid rule")
continue
}
if err := c.rules.Delete(r.Name); err != nil {
log.Error("deleting rule: ", err, r)
if err := c.rules.Delete(rul.Name); err != nil {
log.Error("deleting rule: ", err, rul)
rErr = err
}
}