Live: cleanup and simple changes (#28028)

This commit is contained in:
Ryan McKinley
2020-10-04 23:53:52 -07:00
committed by GitHub
parent 0ffd9a9a3c
commit 726bb4477b
12 changed files with 98 additions and 61 deletions
+1 -1
View File
@@ -426,7 +426,7 @@ func (hs *HTTPServer) registerRoutes() {
// Live streaming
if hs.Live != nil {
r.Any("/live/*", hs.Live.Handler)
r.Any("/live/*", hs.Live.WebsocketHandler)
}
// Snapshots
+2 -2
View File
@@ -31,7 +31,7 @@ type GrafanaLive struct {
node *centrifuge.Node
// The websocket handler
Handler interface{}
WebsocketHandler interface{}
// Full channel handler
channels map[string]models.ChannelHandler
@@ -171,7 +171,7 @@ func InitializeBroker() (*GrafanaLive, error) {
WriteBufferSize: 1024,
})
glive.Handler = func(ctx *models.ReqContext) {
glive.WebsocketHandler = func(ctx *models.ReqContext) {
user := ctx.SignedInUser
if user == nil {
ctx.Resp.WriteHeader(401)