From 51bfc9422d1b5401338a0ef95e039a68521fe8cd Mon Sep 17 00:00:00 2001 From: Enzo Simonnet <enzosim@laposte.net> Date: Wed, 31 Jan 2024 11:16:51 -0500 Subject: [PATCH] version sans check timeout (simple) --- src/Manager/WiktionaryManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Manager/WiktionaryManager.php b/src/Manager/WiktionaryManager.php index 51f4cbd..1725467 100644 --- a/src/Manager/WiktionaryManager.php +++ b/src/Manager/WiktionaryManager.php @@ -72,7 +72,7 @@ class WiktionaryManager $client = HttpClient::create(); // Make the initial request with a timeout - try { + //try { $response = $client->request('GET', $url, ['timeout' => 2.5]); // Check the HTTP status code @@ -80,7 +80,7 @@ class WiktionaryManager // Server is up and returned a successful response $result = $response->getContent(); } - } catch (TransportExceptionInterface $exception) { + /*} catch (TransportExceptionInterface $exception) { // Handle timeout for the initial request $startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py'; exec($startServerCommand); @@ -93,7 +93,7 @@ class WiktionaryManager $startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py'; exec($startServerCommand); } - } + }*/ //dump(gettype($result));dump($url);dump(microtime(true)-$time_start);dump($result);/*Debug*/ // Output and error handling -- GitLab