From 8ce6428149def49a7d17170b6926f85cdafd4162 Mon Sep 17 00:00:00 2001 From: Bram Date: Sat, 12 Jul 2025 17:48:26 +0200 Subject: [PATCH] setable timeout --- Dockers/puppeteer-healthcheck/healthcheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockers/puppeteer-healthcheck/healthcheck.py b/Dockers/puppeteer-healthcheck/healthcheck.py index f8d7551..5d82dcd 100644 --- a/Dockers/puppeteer-healthcheck/healthcheck.py +++ b/Dockers/puppeteer-healthcheck/healthcheck.py @@ -32,6 +32,7 @@ class PuppeteerHealthcheck: self.target_container = os.getenv('TARGET_CONTAINER', 'puppeteer-api') self.check_interval = int(os.getenv('CHECK_INTERVAL', '60')) self.max_consecutive_failures = int(os.getenv('MAX_CONSECUTIVE_FAILURES', '3')) + self.timeout = int(os.getenv('TIMEOUT', '20')) # Initialize Docker client with proper error handling self.docker_client = self._initialize_docker_client() @@ -41,6 +42,7 @@ class PuppeteerHealthcheck: logger.info(f" Test URL: {self.test_url}") logger.info(f" Target Container: {self.target_container}") logger.info(f" Check Interval: {self.check_interval} seconds") + logger.info(f" Timeout: {self.timeout} seconds") def _initialize_docker_client(self): """Initialize Docker client with proper error handling""" @@ -81,7 +83,7 @@ class PuppeteerHealthcheck: response = requests.get( url, headers=headers, - timeout=30, + timeout=self.timeout, allow_redirects=True )