From ef9d81f3ff5a20a8c13086d0322d954c3c1b6a3c Mon Sep 17 00:00:00 2001 From: i573718 Date: Tue, 15 Oct 2024 14:11:27 +0000 Subject: [PATCH] Only return limit number of rows --- pkg/server/server.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index 54e0b74..4857506 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -351,7 +351,13 @@ func newHandlePull(backendConf backendConf) func(http.ResponseWriter, *http.Requ log.Errorf("Could not generate continue filter: %v", err) } - output := map[string]interface{}{"response": rows} + output := make(map[string]interface{}) + if len(rows) <= filter.Limit { + output["response"] = rows + } else { + output["response"] = rows[:filter.Limit] + } + if conFilter != nil { output["continueFilter"] = conFilter } @@ -390,7 +396,6 @@ func parseFilter(vals url.Values) (Filter, error) { return filter, nil } - log.Info(filterStr) err := json.Unmarshal([]byte(filterStr), &filter) if err != nil { log.Errorf("Errror unmarshalling: %v", err)