Bug when too many requests
-
Hi,
I use your plugin to find price of product (with ASIN) on Amazon, and stock their price in a custom field of my WP product.
I use a CRON Job which execute my code each night. This code call your shortcode for all my products (one per one) and stock the return price in my WP custom field.
But, the result is random. Somes prices are good and many other are empty.
In my opinion, your plugin does’nt support the fact that many requests for all my products (about 30) are send in the same time.
What about you ? Do you have a solution ?
Would it be a good idea to put a “break” (in the code) after each call to Amazon and continu to execut ? How can I do this ?
Thanks for your answer, and sorry for my poor english !
Best regards
if($v1_asin != ''){ $short_ama_price = ('asin='.$v1_asin.'&template=price'); if (function_exists(amazon_shortcode)) { $api_price_ama = amazon_shortcode($short_ama_price); if($api_price_ama == '-') { $api_price_ama = ''; } else { $api_price_ama = str_replace('EUR ','',$api_price_ama); } } $short_ama_url = ('asin='.$v1_asin.'&template=url'); if (function_exists(amazon_shortcode)) { $api_url_ama = amazon_shortcode($short_ama_url); } update_field('v1_amazon_price', $api_price_ama, $post_id); update_field('v1_amazon_url', $api_url_ama, $post_id); }
The topic ‘Bug when too many requests’ is closed to new replies.