mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Live: prepend orgId when publishing from HTTP (#38775)
This commit is contained in:
parent
e980f8531a
commit
e461c722bf
@ -65,5 +65,5 @@ func (b *BroadcastRunner) OnPublish(_ context.Context, u *models.SignedInUser, e
|
||||
if err := b.liveMessageStore.SaveLiveMessage(query); err != nil {
|
||||
return models.PublishReply{}, 0, err
|
||||
}
|
||||
return models.PublishReply{}, backend.PublishStreamStatusOK, nil
|
||||
return models.PublishReply{Data: e.Data}, backend.PublishStreamStatusOK, nil
|
||||
}
|
||||
|
@ -81,5 +81,5 @@ func TestBroadcastRunner_OnPublish(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, backend.PublishStreamStatusOK, status)
|
||||
require.Nil(t, reply.Data)
|
||||
require.Equal(t, data, reply.Data)
|
||||
}
|
||||
|
@ -746,7 +746,7 @@ func (g *GrafanaLive) HandleHTTPPublish(ctx *models.ReqContext, cmd dtos.LivePub
|
||||
return response.Error(code, text, nil)
|
||||
}
|
||||
if reply.Data != nil {
|
||||
_, err = g.node.Publish(cmd.Channel, cmd.Data)
|
||||
err = g.Publish(ctx.OrgId, cmd.Channel, cmd.Data)
|
||||
if err != nil {
|
||||
logger.Error("Error publish to channel", "error", err, "channel", cmd.Channel)
|
||||
return response.Error(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError), nil)
|
||||
|
Loading…
Reference in New Issue
Block a user