diff xml/getAmazonInfo.php @ 7:1dfe64e365a0

a bit more debugging/bomb-proofing
author Robert Boland <robert@markup.co.uk>
date Fri, 17 Feb 2017 13:40:20 +0000
parents 55445b456ad0
children 232deb0b066a
line wrap: on
line diff
--- a/xml/getAmazonInfo.php	Thu Feb 16 22:29:02 2017 +0000
+++ b/xml/getAmazonInfo.php	Fri Feb 17 13:40:20 2017 +0000
@@ -118,7 +118,11 @@
 	  $resName=$xml->getName();
 	  $code=$xml->Error->Code;
 	  file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, ".
-			    $xml->Error->Code."\n",FILE_APPEND);
+			    $code."\n",FILE_APPEND);
+	  if ($code=='RequestThrottled') {
+	    usleep(200000); // Try to reduce throttling until we get a 
+	    // principled solution in place
+	  }
 	}
 	else {
 	  $xml = new SimpleXMLElement($output);