From 0f8d95e29d7fd530202411176d50df3227d40b02 Mon Sep 17 00:00:00 2001 From: Cong Zhao Date: Mon, 26 Nov 2018 10:48:39 +0800 Subject: [PATCH] #262 Fix tx search pagination --- rpc/core/README.md | 4 ++-- rpc/core/pipe.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rpc/core/README.md b/rpc/core/README.md index 32c3051e3..e1c4bc84b 100644 --- a/rpc/core/README.md +++ b/rpc/core/README.md @@ -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. diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index 188ea1c36..ae81d35bd 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -18,7 +18,7 @@ import ( const ( // see README defaultPerPage = 30 - maxPerPage = 100 + maxPerPage = 10000 ) var subscribeTimeout = 5 * time.Second @@ -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