|
cannonballdex - 22 November 2008 01:15 PM Now sure how large your google base file is, but this is straight from google.
If your file is smaller than 20 MB, we suggest submitting your file instead directly through Google Base. If your file is larger than this, you must upload via FTP (File Transfer Protocol).
I believe that cannonballdex is correct and this is likely why it may fail at times. Based on the link in the first post in this thread, I explored some ideas on how to keep the Magento login session alive with the Google Base API. This is what I came up with (below). I would like to ask someone else to try this out as well. I am not getting any failures when adding products to Google Base now. I have large sized products so I have always gotten a failure when trying to upload 200 products--100 products works though.
I am no able to upload hundreds of products and have not had it fail yet.
I hope it helps you too!
Simple explanation for the changes: I am adding the Google API login client session to the Mage/Zend Registry. Whenever Mage tries to create a new API login, if it exists in the Registry, it just uses it. I am an hour into adding all of my products (18,000 +) to Google Base and it is still running without failure.
Simply change the try block per below in /web/app/code/core/Mage/GoogleBase/Model/Service.php:
Change this…
// Create an authenticated HTTP client $errorMsg = Mage::helper('googlebase')->__('Unable to connect to Google Base. Please, check Account settings in configuration.'); try { $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, '', $loginToken, $loginCaptcha, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, $type ); } catch (Zend_Gdata_App_CaptchaRequiredException $e) {
...to this…
// Create an authenticated HTTP client $errorMsg = Mage::helper('googlebase')->__('Unable to connect to Google Base. Please, check Account settings in configuration.'); try { if (!Mage::registry('GAPI_CLIENT')) { $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, '', $loginToken, $loginCaptcha, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, $type ); Mage::register('GAPI_CLIENT', $client); } else { $client = Mage::registry('GAPI_CLIENT'); } } catch (Zend_Gdata_App_CaptchaRequiredException $e) {
Good luck, I really hope it helps and be sure to post your success!
|