Browse Source

remove unused code

Marcus Efraimsson 7 years ago
parent
commit
d412aafb7e
2 changed files with 0 additions and 30 deletions
  1. 0 7
      pkg/models/alert_notifications.go
  2. 0 23
      pkg/services/sqlstore/alert_notification.go

+ 0 - 7
pkg/models/alert_notifications.go

@@ -111,10 +111,3 @@ type GetNotificationStateQuery struct {
 	Result *AlertNotificationState
 	Result *AlertNotificationState
 }
 }
 
 
-type InsertAlertNotificationCommand struct {
-	OrgId      int64
-	AlertId    int64
-	NotifierId int64
-	SentAt     int64
-	State      AlertNotificationStateType
-}

+ 0 - 23
pkg/services/sqlstore/alert_notification.go

@@ -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