Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

[R4R] #262 Fix tx search pagination #12

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rpc/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ make rpc-docs
## Pagination

Requests that return multiple items will be paginated to 30 items by default.
You can specify further pages with the ?page parameter. You can also set a
custom page size up to 100 with the ?per_page parameter.
You can specify further pages with the `?page` parameter. You can also set a
custom page size up to 10000 with the `?per_page` parameter.
3 changes: 2 additions & 1 deletion rpc/core/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
const (
// see README
defaultPerPage = 30
maxPerPage = 100
maxPerPage = 10000
)

var subscribeTimeout = 5 * time.Second
Expand Down Expand Up @@ -151,6 +151,7 @@ func validatePage(page, perPage, totalCount int) int {

func validatePerPage(perPage int) int {
if perPage < 1 || perPage > maxPerPage {
logger.Error("Wrong perPage parameter", "perPage", perPage, "defaultPerPage", defaultPerPage)
return defaultPerPage
}
return perPage
Expand Down