|
|
@@ -2,12 +2,10 @@ package sqlstore
|
|
|
|
|
|
import (
|
|
|
"bytes"
|
|
|
- "context"
|
|
|
"fmt"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
- "github.com/go-xorm/xorm"
|
|
|
"github.com/grafana/grafana/pkg/bus"
|
|
|
m "github.com/grafana/grafana/pkg/models"
|
|
|
)
|
|
|
@@ -248,21 +246,6 @@ func RecordNotificationJournal(cmd *m.RecordNotificationJournalCommand) error {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-func startSession(ctx context.Context) *DBSession {
|
|
|
- value := ctx.Value("db-session")
|
|
|
- var sess *xorm.Session
|
|
|
- sess, ok := value.(*xorm.Session)
|
|
|
-
|
|
|
- if !ok {
|
|
|
- return newSession()
|
|
|
- }
|
|
|
-
|
|
|
- old := newSession()
|
|
|
- old.Session = sess
|
|
|
-
|
|
|
- return old
|
|
|
-}
|
|
|
-
|
|
|
func GetLatestNotification(cmd *m.GetLatestNotificationQuery) error {
|
|
|
return inTransaction(func(sess *DBSession) error {
|
|
|
notificationJournal := &m.AlertNotificationJournal{}
|