Skip to content

Commit

Permalink
Only return limit number of rows
Browse files Browse the repository at this point in the history
  • Loading branch information
lsroe committed Oct 15, 2024
1 parent a1819e2 commit ef9d81f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ef9d81f

Please sign in to comment.