mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: wrap data.Frame in a backend.DataResponse and return it directly when the index is not ready (#56611)
This commit is contained in:
parent
25e89ba295
commit
1bbbe41a6c
@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
@ -36,14 +37,12 @@ func (s *searchHTTPService) doQuery(c *models.ReqContext) response.Response {
|
||||
"reason": searchReadinessCheckResp.Reason,
|
||||
}).Inc()
|
||||
|
||||
bytes, err := (&data.Frame{
|
||||
return response.JSON(200, &backend.DataResponse{
|
||||
Frames: []*data.Frame{{
|
||||
Name: "Loading",
|
||||
}).MarshalJSON()
|
||||
|
||||
if err != nil {
|
||||
return response.Error(500, "error marshalling response", err)
|
||||
}
|
||||
return response.JSON(200, bytes)
|
||||
}},
|
||||
Error: nil,
|
||||
})
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(c.Req.Body)
|
||||
|
Loading…
Reference in New Issue
Block a user