From 0ce65943ba38cc45290006023b6994fe949eff5a Mon Sep 17 00:00:00 2001 From: Akiff Manji Date: Mon, 25 Oct 2021 09:37:31 -0700 Subject: [PATCH 1/2] Set paging back to 10 per result. Paging is configurable from env Signed-off-by: Akiff Manji --- docker/docker-compose.yml | 2 ++ docker/manage | 3 +++ server/vcr-server/vcr_server/settings.py | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 08dc26374..8dd244a1c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -79,6 +79,8 @@ services: - RTI_RAISE_ERRORS=${RTI_RAISE_ERRORS} - RANDOM_ERRORS=${RANDOM_ERRORS} - STARTUP_DELAY=${STARTUP_DELAY} + - PAGE_SIZE=${PAGE_SIZE} + - MAX_PAGE_SIZE=${MAX_PAGE_SIZE} volumes: - ../server/vcr-server/subscriptions:/home/indy/subscriptions - ../server/vcr-server/agent_webhooks:/home/indy/agent_webhooks diff --git a/docker/manage b/docker/manage index baa9ae068..d8b49f54d 100755 --- a/docker/manage +++ b/docker/manage @@ -354,6 +354,9 @@ configureEnvironment() { export SP_TRACKING_EMITTER=${SP_TRACKING_EMITTER:-spm.apps.gov.bc.ca} export SP_TRACKING_EMITTER_PROTOCOL=${SP_TRACKING_EMITTER_PROTOCOL:-https} + export PAGE_SIZE=${PAGE_SIZE:-10} + export MAX_PAGE_SIZE=${MAX_PAGE_SIZE:-200} + # rabbitmq export RABBITMQ_USER="RABBITMQ_USER" export RABBITMQ_PASSWORD="RABBITMQ_PASSWORD" diff --git a/server/vcr-server/vcr_server/settings.py b/server/vcr-server/vcr_server/settings.py index f7489bf7c..ec2f14903 100644 --- a/server/vcr-server/vcr_server/settings.py +++ b/server/vcr-server/vcr_server/settings.py @@ -165,8 +165,8 @@ def parse_bool(val): REST_FRAMEWORK = { # "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "DEFAULT_PAGINATION_CLASS": "vcr_server.pagination.EnhancedPageNumberPagination", - "PAGE_SIZE": 100, - "MAX_PAGE_SIZE": 200, + "PAGE_SIZE": int(os.getenv("PAGE_SIZE", "10")), + "MAX_PAGE_SIZE": int(os.getenv("MAX_PAGE_SIZE", "100")), "DEFAULT_AUTHENTICATION_CLASSES": authentication.defaults(), "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly" From 800fe4b232f97521573631123b0074fa1c145b29 Mon Sep 17 00:00:00 2001 From: Akiff Manji Date: Mon, 25 Oct 2021 10:22:09 -0700 Subject: [PATCH 2/2] Set max paging back to 200 Signed-off-by: Akiff Manji --- server/vcr-server/vcr_server/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/vcr-server/vcr_server/settings.py b/server/vcr-server/vcr_server/settings.py index ec2f14903..7e9982691 100644 --- a/server/vcr-server/vcr_server/settings.py +++ b/server/vcr-server/vcr_server/settings.py @@ -166,7 +166,7 @@ def parse_bool(val): # "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "DEFAULT_PAGINATION_CLASS": "vcr_server.pagination.EnhancedPageNumberPagination", "PAGE_SIZE": int(os.getenv("PAGE_SIZE", "10")), - "MAX_PAGE_SIZE": int(os.getenv("MAX_PAGE_SIZE", "100")), + "MAX_PAGE_SIZE": int(os.getenv("MAX_PAGE_SIZE", "200")), "DEFAULT_AUTHENTICATION_CLASSES": authentication.defaults(), "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly"