From 76612e5d0ea5796172c8e5ededef4a750d1f23ba Mon Sep 17 00:00:00 2001 From: void-spark <81029971+void-spark@users.noreply.github.com> Date: Mon, 11 May 2026 22:09:07 +0200 Subject: [PATCH] Change default timeout to 10 seconds, match request timeout to script timeout -1 second. Always use at least 1 sec. timeout for request. --- front/plugins/kea_api/config.json | 2 +- front/plugins/kea_api/script.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/front/plugins/kea_api/config.json b/front/plugins/kea_api/config.json index ffa434bd..6bc00f3d 100644 --- a/front/plugins/kea_api/config.json +++ b/front/plugins/kea_api/config.json @@ -306,7 +306,7 @@ } ] }, - "default_value": 5, + "default_value": 10, "options": [], "localized": ["name", "description"], "name": [ diff --git a/front/plugins/kea_api/script.py b/front/plugins/kea_api/script.py index 74d543f8..a772929d 100644 --- a/front/plugins/kea_api/script.py +++ b/front/plugins/kea_api/script.py @@ -23,12 +23,13 @@ def main(): url = get_setting_value(f'{pluginName}_URL') user = get_setting_value(f'{pluginName}_USER') password = get_setting_value(f'{pluginName}_PASS') + timeout = get_setting_value(f'{pluginName}_RUN_TIMEOUT') mylog('verbose', [f'[{pluginName}] Querying Kea API at {url}']) payload = {'command': 'lease4-get-all', 'service': ['dhcp4']} - response = requests.post(url, json=payload, auth=(user, password), timeout=10) + response = requests.post(url, json=payload, auth=(user, password), timeout=max(1, timeout - 1)) response.raise_for_status() data = response.json()