From 55e286972d826f7e9c64ba61ab5ad3acb3c34536 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 5 Oct 2024 04:24:07 -0700 Subject: [PATCH] fix timeout check showing regardless of value --- archivebox/config/defaults.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/archivebox/config/defaults.py b/archivebox/config/defaults.py index c45a3068..e4146f25 100644 --- a/archivebox/config/defaults.py +++ b/archivebox/config/defaults.py @@ -182,13 +182,14 @@ class ArchivingConfig(BaseConfigSet): @field_validator('TIMEOUT', mode='after') def validate_timeout(cls, v): - print(f'[red][!] Warning: TIMEOUT is set too low! (currently set to TIMEOUT={v} seconds)[/red]', file=sys.stderr) - print(' You must allow *at least* 5 seconds for indexing and archive methods to run succesfully.', file=sys.stderr) - print(' (Setting it to somewhere between 30 and 3000 seconds is recommended)', file=sys.stderr) - print(file=sys.stderr) - print(' If you want to make ArchiveBox run faster, disable specific archive methods instead:', file=sys.stderr) - print(' https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#archive-method-toggles', file=sys.stderr) - print(file=sys.stderr) + if int(v) < 5: + print(f'[red][!] Warning: TIMEOUT is set too low! (currently set to TIMEOUT={v} seconds)[/red]', file=sys.stderr) + print(' You must allow *at least* 5 seconds for indexing and archive methods to run succesfully.', file=sys.stderr) + print(' (Setting it to somewhere between 30 and 3000 seconds is recommended)', file=sys.stderr) + print(file=sys.stderr) + print(' If you want to make ArchiveBox run faster, disable specific archive methods instead:', file=sys.stderr) + print(' https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#archive-method-toggles', file=sys.stderr) + print(file=sys.stderr) return v @field_validator('CHECK_SSL_VALIDITY', mode='after')