Skip to content
Snippets Groups Projects
Commit 51bfc942 authored by Enzo Simonnet's avatar Enzo Simonnet
Browse files

version sans check timeout (simple)

parent 4fc1993c
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ class WiktionaryManager ...@@ -72,7 +72,7 @@ class WiktionaryManager
$client = HttpClient::create(); $client = HttpClient::create();
// Make the initial request with a timeout // Make the initial request with a timeout
try { //try {
$response = $client->request('GET', $url, ['timeout' => 2.5]); $response = $client->request('GET', $url, ['timeout' => 2.5]);
// Check the HTTP status code // Check the HTTP status code
...@@ -80,7 +80,7 @@ class WiktionaryManager ...@@ -80,7 +80,7 @@ class WiktionaryManager
// Server is up and returned a successful response // Server is up and returned a successful response
$result = $response->getContent(); $result = $response->getContent();
} }
} catch (TransportExceptionInterface $exception) { /*} catch (TransportExceptionInterface $exception) {
// Handle timeout for the initial request // Handle timeout for the initial request
$startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py'; $startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py';
exec($startServerCommand); exec($startServerCommand);
...@@ -93,7 +93,7 @@ class WiktionaryManager ...@@ -93,7 +93,7 @@ class WiktionaryManager
$startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py'; $startServerCommand = '/var/www/live-query-wiktextract/venv/bin/python3 /var/www/live-query-wiktextract/src/app.py';
exec($startServerCommand); exec($startServerCommand);
} }
} }*/
//dump(gettype($result));dump($url);dump(microtime(true)-$time_start);dump($result);/*Debug*/ //dump(gettype($result));dump($url);dump(microtime(true)-$time_start);dump($result);/*Debug*/
// Output and error handling // Output and error handling
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment