Validate external core shutdown timeouts

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-09-19 20:48:10 +08:00
parent 87597d7ffd
commit aa6bd6dcde
3 changed files with 24 additions and 3 deletions
@@ -232,9 +232,14 @@ class ConfigExternalCore(CoreConfiguration):
'Shutdown timeout must be a number of seconds'
)
value = float(value)
try:
value = float(value)
except OverflowError as ex:
raise ExternalCoreConfigurationError(
'Shutdown timeout must be between 0.1 and 60 seconds'
) from ex
if value < 0.1 or value > 60:
if not 0.1 <= value <= 60:
raise ExternalCoreConfigurationError(
'Shutdown timeout must be between 0.1 and 60 seconds'
)