mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
update Evaluator interface to accept context (#52151)
This commit is contained in:
@@ -55,7 +55,7 @@ func (srv TestingApiSrv) RouteTestGrafanaRuleConfig(c *models.ReqContext, body a
|
||||
now = timeNow()
|
||||
}
|
||||
|
||||
evalResults := srv.evaluator.ConditionEval(evalCond, now)
|
||||
evalResults := srv.evaluator.ConditionEval(c.Req.Context(), evalCond, now)
|
||||
|
||||
frame := evalResults.AsDataFrame()
|
||||
return response.JSONStreaming(http.StatusOK, util.DynMap{
|
||||
@@ -118,7 +118,7 @@ func (srv TestingApiSrv) RouteEvalQueries(c *models.ReqContext, cmd apimodels.Ev
|
||||
return ErrResp(http.StatusBadRequest, err, "invalid queries or expressions")
|
||||
}
|
||||
|
||||
evalResults, err := srv.evaluator.QueriesAndExpressionsEval(c.SignedInUser.OrgId, cmd.Data, now)
|
||||
evalResults, err := srv.evaluator.QueriesAndExpressionsEval(c.Req.Context(), c.SignedInUser.OrgId, cmd.Data, now)
|
||||
if err != nil {
|
||||
return ErrResp(http.StatusBadRequest, err, "Failed to evaluate queries and expressions")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user