fix(store): max records per query

This commit is contained in:
Richard Ramos 2022-11-23 18:12:36 -04:00 committed by RichΛrd
parent 5d7d05ca16
commit 04a2a3fbae
1 changed files with 5 additions and 1 deletions

View File

@ -481,7 +481,11 @@ func (store *WakuStore) Query(ctx context.Context, query Query, opts ...HistoryR
q.PagingInfo.Direction = pb.PagingInfo_BACKWARD q.PagingInfo.Direction = pb.PagingInfo_BACKWARD
} }
q.PagingInfo.PageSize = params.pageSize pageSize := params.pageSize
if pageSize == 0 || pageSize > uint64(MaxPageSize) {
pageSize = MaxPageSize
}
q.PagingInfo.PageSize = pageSize
response, err := store.queryFrom(ctx, q, params.selectedPeer, params.requestId) response, err := store.queryFrom(ctx, q, params.selectedPeer, params.requestId)
if err != nil { if err != nil {