From 97c955045d4e613abf4be7f179eabaae43866be6 Mon Sep 17 00:00:00 2001 From: Gabriel Moreira Date: Thu, 21 Nov 2024 10:35:38 +0100 Subject: [PATCH] refactor: decrease max_page_size to 500 - Fetching the heaviest endpoint (TH2) using page_size=1000 took almost 20 seconds and returned 149M (tracker - StreamExpress 2024A - 378294 - PixelPhase1/Tracks/PXForward/clusterposition_xy_ontrack_PXDisk_-1). To avoid reaching the 30 seconds limit, page_size=500 is doable for the same parameters (76.6M, 13 seconds). --- backend/utils/pagination.py | 2 +- frontend/src/views/browser/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/utils/pagination.py b/backend/utils/pagination.py index 24fa5af..6b68b17 100644 --- a/backend/utils/pagination.py +++ b/backend/utils/pagination.py @@ -19,7 +19,7 @@ class DynamicMultiOrderingCursorPagination(CursorPagination): cursor_query_param = "next_token" ordering_param = "order_by" page_size_query_param = "page_size" - max_page_size = 1000 + max_page_size = 500 def get_ordering(self, request, queryset, view): default_order_by = list(queryset.query.order_by) diff --git a/frontend/src/views/browser/index.jsx b/frontend/src/views/browser/index.jsx index 48f5150..8b1dcd3 100644 --- a/frontend/src/views/browser/index.jsx +++ b/frontend/src/views/browser/index.jsx @@ -13,7 +13,7 @@ import API from '../../services/api' import { buildTree } from '../../utils/ops' const Browser = () => { - const defaultPageSize = 1000 + const defaultPageSize = 500 const [isLoadingDatasets, setIsLoadingDatasets] = useState(true) const [datasets, setDatasets] = useState()