Skip to content

Commit

Permalink
Fixes validation diagnostics (#2303)
Browse files Browse the repository at this point in the history
* Fixes validation of max_task_delay

* Sets task-delay to 30secs and updates environs
  • Loading branch information
pcrespov committed Apr 29, 2021
1 parent 4fefd8f commit ac7b361
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit ac7b361

Please sign in to comment.