fix(keystone): avoid repeated abnormal login notifications

This commit is contained in:
rainzm
2021-01-29 20:05:05 +08:00
parent f5f02b5e09
commit c4c3b925b8
+2
View File
@@ -112,6 +112,8 @@ func (sql *SSQLDriver) alertNotify(ctx context.Context, uext *api.SUserExtended,
userSet := sets.NewString(daUserIds...)
userSet.Insert(aUserIds...)
data.Set("admin", jsonutils.JSONTrue)
// prevent duplicate messages
userSet.Delete(uext.Id)
p.RecipientId = userSet.UnsortedList()
p.Data = data
notifyclient.NotifyWithTag(ctx, p)