Skip to content

Commit 85b317d

Browse files
feature: Adds 300-rec hisRead limit
1 parent aa1a945 commit 85b317d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/plugin/datasource.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ func (datasource *Datasource) query(ctx context.Context, pCtx backend.PluginCont
172172
return backend.ErrDataResponse(backend.StatusBadRequest, fmt.Sprintf("HisReadFilter failure: %v", readErr.Error()))
173173
}
174174
points := pointsGrid.Rows()
175+
recLimit := 300
176+
if len(points) > recLimit {
177+
errMsg := fmt.Sprintf("Query exceeded record limit of %d: %d records", recLimit, len(points))
178+
log.DefaultLogger.Error(errMsg)
179+
return backend.ErrDataResponse(backend.StatusBadRequest, errMsg)
180+
}
175181

176182
// Function to read a single point and send it to a channel.
177183
readPoint := func(point haystack.Row, hisReadChannel chan haystack.Grid, wg *sync.WaitGroup) {

0 commit comments

Comments
 (0)