From ac7b3617e3402661162b52eba9389c4041e83289 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Wed, 28 Apr 2021 22:27:51 +0200 Subject: [PATCH] Fixes validation diagnostics (#2303) * Fixes validation of max_task_delay * Sets task-delay to 30secs and updates environs --- services/docker-compose.yml | 8 ++++---- .../src/simcore_service_webserver/diagnostics_config.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/services/docker-compose.yml b/services/docker-compose.yml index de88b54e85b..a67f16d4af4 100644 --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -117,18 +117,18 @@ services: image: ${DOCKER_REGISTRY:-itisfoundation}/webserver:${DOCKER_IMAGE_TAG:-latest} init: true environment: + - CATALOG_HOST=${CATALOG_HOST:-catalog} + - CATALOG_PORT=${CATALOG_PORT:-8000} + - DIAGNOSTICS_MAX_AVG_LATENCY=10 + - DIAGNOSTICS_MAX_TASK_DELAY=30 - DIRECTOR_HOST=${DIRECTOR_HOST:-director} - DIRECTOR_PORT=${DIRECTOR_PORT:-8080} - DIRECTOR_V2_HOST=${DIRECTOR_V2_HOST:-director-v2} - DIRECTOR_V2_PORT=${DIRECTOR_V2_PORT:-8000} - STORAGE_HOST=${STORAGE_HOST:-storage} - STORAGE_PORT=${STORAGE_PORT:-8080} - - CATALOG_HOST=${CATALOG_HOST:-catalog} - - CATALOG_PORT=${CATALOG_PORT:-8000} - SWARM_STACK_NAME=${SWARM_STACK_NAME:-simcore} - WEBSERVER_LOGLEVEL=${LOG_LEVEL:-WARNING} - - DIAGNOSTICS_MAX_DELAY_SECS=30 - - DIAGNOSTICS_MAX_AVG_LATENCY=10 env_file: - ../.env deploy: diff --git a/services/web/server/src/simcore_service_webserver/diagnostics_config.py b/services/web/server/src/simcore_service_webserver/diagnostics_config.py index 0c89dcbbf80..838668975d2 100644 --- a/services/web/server/src/simcore_service_webserver/diagnostics_config.py +++ b/services/web/server/src/simcore_service_webserver/diagnostics_config.py @@ -33,11 +33,12 @@ class DiagnosticsSettings(BaseSettings): start_sensing_delay: NonNegativeFloat = 60.0 @validator("max_task_delay", pre=True) + @classmethod def validate_max_task_delay(cls, v, values): - slow_duration_secs = values["slow_duration_secs"] + slow_duration_secs = float(values["slow_duration_secs"]) return max( 10 * slow_duration_secs, - v, + float(v), ) # secs