Tracking Push Notifications in a structured logger (notifications.log) (#10823)
* Remove NotificationRegistry table and use structured logging * Fix ackId for notification sent * Notification logger at server level * Remove unused i18n strings
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
30061df036
Коммит
5b252e8736
@@ -308,16 +308,13 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
||||
)
|
||||
} else {
|
||||
// register that a notification was not sent
|
||||
notificationRegistry := model.NotificationRegistry{
|
||||
UserId: id,
|
||||
PostId: post.Id,
|
||||
SendStatus: model.PUSH_NOT_SENT,
|
||||
Type: model.PUSH_TYPE_MESSAGE,
|
||||
}
|
||||
_, appErr := a.Srv.Store.NotificationRegistry().Save(¬ificationRegistry)
|
||||
if appErr != nil {
|
||||
mlog.Debug(appErr.Error())
|
||||
}
|
||||
a.NotificationsLog.Warn("Notification not sent",
|
||||
mlog.String("ackId", ""),
|
||||
mlog.String("type", model.PUSH_TYPE_MESSAGE),
|
||||
mlog.String("userId", id),
|
||||
mlog.String("postId", post.Id),
|
||||
mlog.String("status", model.PUSH_NOT_SENT),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,16 +340,13 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
||||
)
|
||||
} else {
|
||||
// register that a notification was not sent
|
||||
notificationRegistry := model.NotificationRegistry{
|
||||
UserId: id,
|
||||
PostId: post.Id,
|
||||
SendStatus: model.PUSH_NOT_SENT,
|
||||
Type: model.PUSH_TYPE_MESSAGE,
|
||||
}
|
||||
_, appErr := a.Srv.Store.NotificationRegistry().Save(¬ificationRegistry)
|
||||
if appErr != nil {
|
||||
mlog.Debug(appErr.Error())
|
||||
}
|
||||
a.NotificationsLog.Warn("Notification not sent",
|
||||
mlog.String("ackId", ""),
|
||||
mlog.String("type", model.PUSH_TYPE_MESSAGE),
|
||||
mlog.String("userId", id),
|
||||
mlog.String("postId", post.Id),
|
||||
mlog.String("status", model.PUSH_NOT_SENT),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user