From a4a7d2e1b3fd5af363bf6d4d113192f87adcfd8f Mon Sep 17 00:00:00 2001 From: Findeton Date: Tue, 25 Jun 2024 14:03:58 -0500 Subject: [PATCH] wip --- config.yml | 1 + iam/templates/deploy.py | 3 +++ iam/templates/test_settings.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/config.yml b/config.yml index 581492d..38f2265 100644 --- a/config.yml +++ b/config.yml @@ -183,6 +183,7 @@ config: # play.http.parser.maxDiskBuffer (in ballot-box config) # play.http.parser.maxMemoryBuffer (in ballot-box config) # parsers.text.maxLength (in ballot-box config) + # DATA_UPLOAD_MAX_MEMORY_SIZE (in iam config) # client_max_body_size (in nginx) max_body_size: 2m diff --git a/iam/templates/deploy.py b/iam/templates/deploy.py index 72707a4..49c3471 100644 --- a/iam/templates/deploy.py +++ b/iam/templates/deploy.py @@ -223,4 +223,7 @@ def on_celery_setup_logging(**kwargs): {{extra_option}} {% endfor %} +{% set max_body_size_bytes = (config.http.max_body_size[:-1] | int) * 1024 * 1024 %} + +DATA_UPLOAD_MAX_MEMORY_SIZE = {{ max_body_size_bytes }} diff --git a/iam/templates/test_settings.py b/iam/templates/test_settings.py index c19836a..3c2f30f 100644 --- a/iam/templates/test_settings.py +++ b/iam/templates/test_settings.py @@ -249,6 +249,10 @@ class CeleryConfig: ENABLE_MULTIPLE_TALLIES = False +{% set max_body_size_bytes = (config.http.max_body_size[:-1] | int) * 1024 * 1024 %} + +DATA_UPLOAD_MAX_MEMORY_SIZE = {{ max_body_size_bytes }} + if not os.path.exists(IMAGE_STORE_PATH): os.mkdir(IMAGE_STORE_PATH)