lenhan10th / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

IOException #370

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Doing massive end following requests for Google Translate

The script is for a shot one tranlsation of an index.
My script fall down regularly with this message :
Fatal error: Uncaught exception 'Google_IOException' with message 'HTTP Error: 
(0) couldn't connect to host' in 
C:\xampp\htdocs\trad\src\io\Google_CurlIO.php:128 Stack trace: #0 
C:\xampp\htdocs\trad\src\io\Google_REST.php(35): 
Google_CurlIO->makeRequest(Object(Google_HttpRequest)) #1 
C:\xampp\htdocs\trad\src\service\Google_ServiceResource.php(186): 
Google_REST::execute(Object(Google_HttpRequest)) #2 
C:\xampp\htdocs\trad\src\contrib\Google_TranslateService.php(104): 
Google_ServiceResource->__call('list', Array) #3 
C:\xampp\htdocs\trad\traduction.php(172): 
Google_TranslationsServiceResource->listTranslations('B??art Guy', 'en', Array) 
#4 {main} thrown in C:\xampp\htdocs\trad\src\io\Google_CurlIO.php on line 128 

and then the script has to be restarted at the end point.
Sometimes the script can do hundreds requests sometimes just a few tens. 

No solutions found and it's really painful.

Original issue reported on code.google.com by benoit.d...@gmail.com on 16 Aug 2013 at 9:08

GoogleCodeExporter commented 8 years ago
Partial solution using usleep in the loop
<?php
usleep(250000);
?>
The script is still running ; data go in the database. And more than 1000 items 
has still been translated. Don't know if it's good but for sure it's better. 

Original comment by benoit.d...@gmail.com on 16 Aug 2013 at 9:39

GoogleCodeExporter commented 8 years ago
This issue tracker is now closing. Development on the Google PHP client library 
moved to GitHub with the release of the 1.0.0-alpha, and now the 1.0 branch has 
reached beta status there will be no further releases of the 0.6 branch of the 
library. 

Please take a look at the latest version on 
https://github.com/google/google-api-php-client

For information on migrating, please take a look at this guide: 
https://developers.google.com/api-client-library/php/guide/migration

For general library support please ask a question on StackOverflow: 
http://stackoverflow.com/questions/tagged/google-api-php-client

If you are looking for support with a specific API, please contact the team 
working with that API via StackOverflow or their preferred support mechanism. 

If your issue still exists with the new version of the library, please raise a 
bug in the GitHub issue tracker with a minimal code sample. 

Thanks!

Original comment by ianbar...@google.com on 22 Jan 2014 at 4:53