mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
remove unused code
This commit is contained in:
parent
d313ffa847
commit
d412aafb7e
@ -111,10 +111,3 @@ type GetNotificationStateQuery struct {
|
|||||||
Result *AlertNotificationState
|
Result *AlertNotificationState
|
||||||
}
|
}
|
||||||
|
|
||||||
type InsertAlertNotificationCommand struct {
|
|
||||||
OrgId int64
|
|
||||||
AlertId int64
|
|
||||||
NotifierId int64
|
|
||||||
SentAt int64
|
|
||||||
State AlertNotificationStateType
|
|
||||||
}
|
|
||||||
|
@ -19,7 +19,6 @@ func init() {
|
|||||||
bus.AddHandler("sql", DeleteAlertNotification)
|
bus.AddHandler("sql", DeleteAlertNotification)
|
||||||
bus.AddHandler("sql", GetAlertNotificationsToSend)
|
bus.AddHandler("sql", GetAlertNotificationsToSend)
|
||||||
bus.AddHandler("sql", GetAllAlertNotifications)
|
bus.AddHandler("sql", GetAllAlertNotifications)
|
||||||
bus.AddHandlerCtx("sql", InsertAlertNotificationState)
|
|
||||||
bus.AddHandlerCtx("sql", GetAlertNotificationState)
|
bus.AddHandlerCtx("sql", GetAlertNotificationState)
|
||||||
bus.AddHandlerCtx("sql", SetAlertNotificationStateToCompleteCommand)
|
bus.AddHandlerCtx("sql", SetAlertNotificationStateToCompleteCommand)
|
||||||
bus.AddHandlerCtx("sql", SetAlertNotificationStateToPendingCommand)
|
bus.AddHandlerCtx("sql", SetAlertNotificationStateToPendingCommand)
|
||||||
@ -231,28 +230,6 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertAlertNotificationState(ctx context.Context, cmd *m.InsertAlertNotificationCommand) error {
|
|
||||||
return withDbSession(ctx, func(sess *DBSession) error {
|
|
||||||
notificationState := &m.AlertNotificationState{
|
|
||||||
OrgId: cmd.OrgId,
|
|
||||||
AlertId: cmd.AlertId,
|
|
||||||
NotifierId: cmd.NotifierId,
|
|
||||||
SentAt: cmd.SentAt,
|
|
||||||
State: cmd.State,
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := sess.Insert(notificationState); err != nil {
|
|
||||||
if dialect.IsUniqueConstraintViolation(err) {
|
|
||||||
return m.ErrAlertNotificationStateAlreadyExist
|
|
||||||
}
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *m.SetAlertNotificationStateToCompleteCommand) error {
|
func SetAlertNotificationStateToCompleteCommand(ctx context.Context, cmd *m.SetAlertNotificationStateToCompleteCommand) error {
|
||||||
return withDbSession(ctx, func(sess *DBSession) error {
|
return withDbSession(ctx, func(sess *DBSession) error {
|
||||||
version := cmd.State.Version
|
version := cmd.State.Version
|
||||||
|
Loading…
Reference in New Issue
Block a user