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"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
|
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||||
"github.com/grafana/grafana/pkg/api/response"
|
"github.com/grafana/grafana/pkg/api/response"
|
||||||
"github.com/grafana/grafana/pkg/api/routing"
|
"github.com/grafana/grafana/pkg/api/routing"
|
||||||
@ -36,14 +37,12 @@ func (s *searchHTTPService) doQuery(c *models.ReqContext) response.Response {
|
|||||||
"reason": searchReadinessCheckResp.Reason,
|
"reason": searchReadinessCheckResp.Reason,
|
||||||
}).Inc()
|
}).Inc()
|
||||||
|
|
||||||
bytes, err := (&data.Frame{
|
return response.JSON(200, &backend.DataResponse{
|
||||||
Name: "Loading",
|
Frames: []*data.Frame{{
|
||||||
}).MarshalJSON()
|
Name: "Loading",
|
||||||
|
}},
|
||||||
if err != nil {
|
Error: nil,
|
||||||
return response.Error(500, "error marshalling response", err)
|
})
|
||||||
}
|
|
||||||
return response.JSON(200, bytes)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := io.ReadAll(c.Req.Body)
|
body, err := io.ReadAll(c.Req.Body)
|
||||||
|
Loading…
Reference in New Issue
Block a user