Skip to content

Commit

Permalink
♻️ Using iso timedelta in settings (#6656)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Neagu <[email protected]>
  • Loading branch information
GitHK and Andrei Neagu authored Nov 5, 2024
1 parent cd20a2c commit 43f678f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env-devel
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ COMPUTATIONAL_BACKEND_DEFAULT_FILE_LINK_TYPE=PRESIGNED
COMPUTATIONAL_BACKEND_ON_DEMAND_CLUSTERS_FILE_LINK_TYPE=PRESIGNED
DIRECTOR_V2_DEV_FEATURES_ENABLED=0
DIRECTOR_V2_DYNAMIC_SCHEDULER_CLOSE_SERVICES_VIA_FRONTEND_WHEN_CREDITS_LIMIT_REACHED=1
DIRECTOR_V2_DYNAMIC_SIDECAR_SLEEP_AFTER_CONTAINER_REMOVAL=0
DIRECTOR_V2_DYNAMIC_SIDECAR_SLEEP_AFTER_CONTAINER_REMOVAL=PT0S
DIRECTOR_V2_GENERIC_RESOURCE_PLACEMENT_CONSTRAINTS_SUBSTITUTIONS='{}'
DIRECTOR_V2_HOST=director-v2
DIRECTOR_V2_LOGLEVEL=INFO
Expand All @@ -108,7 +108,7 @@ DYNAMIC_SIDECAR_API_SAVE_RESTORE_STATE_TIMEOUT=3600
# DIRECTOR_V2 ----
DYNAMIC_SCHEDULER_LOGLEVEL=DEBUG
DYNAMIC_SCHEDULER_PROFILING=1
DYNAMIC_SCHEDULER_STOP_SERVICE_TIMEOUT=3600
DYNAMIC_SCHEDULER_STOP_SERVICE_TIMEOUT=PT1H

FUNCTION_SERVICES_AUTHORS='{"UN": {"name": "Unknown", "email": "[email protected]", "affiliation": "unknown"}}'

Expand Down
4 changes: 2 additions & 2 deletions services/agent/src/simcore_service_agent/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
AGENT_VOLUMES_CLEANUP_INTERVAL: timedelta = Field(
timedelta(minutes=1), description="interval for running volumes removal"
)
AGENT_VOLUMES_CLENUP_BOOK_KEEPING_INTERVAL: timedelta = Field(
AGENT_VOLUMES_CLEANUP_BOOK_KEEPING_INTERVAL: timedelta = Field(
timedelta(minutes=1),
description=(
"interval at which to scan for unsued volumes and keep track since "
"they were detected as being unused"
),
)
AGENT_VOLUMES_CLENUP_REMOVE_VOLUMES_INACTIVE_FOR: timedelta = Field(
AGENT_VOLUMES_CLEANUP_REMOVE_VOLUMES_INACTIVE_FOR: timedelta = Field(
timedelta(minutes=65),
description=(
"if a volume is unused for more than this interval it can be removed. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ async def _on_startup() -> None:

volumes_manager = VolumesManager(
app=app,
book_keeping_interval=settings.AGENT_VOLUMES_CLENUP_BOOK_KEEPING_INTERVAL,
book_keeping_interval=settings.AGENT_VOLUMES_CLEANUP_BOOK_KEEPING_INTERVAL,
volume_cleanup_interval=settings.AGENT_VOLUMES_CLEANUP_INTERVAL,
remove_volumes_inactive_for=settings.AGENT_VOLUMES_CLENUP_REMOVE_VOLUMES_INACTIVE_FOR.total_seconds(),
remove_volumes_inactive_for=settings.AGENT_VOLUMES_CLEANUP_REMOVE_VOLUMES_INACTIVE_FOR.total_seconds(),
)
volumes_manager.set_to_app_state(app)
await volumes_manager.setup()
Expand Down

0 comments on commit 43f678f

Please sign in to comment.