diff xml/amazonBookSearch.php @ 23:d606320ec331

post-5.7-upgrade efforts to reduce dropped connections, db insertion fails
author Charlie Root
date Sun, 30 Dec 2018 07:00:09 -0500
parents 46382face560
children b1bbf44c701b
line wrap: on
line diff
--- a/xml/amazonBookSearch.php	Sun Dec 30 06:59:13 2018 -0500
+++ b/xml/amazonBookSearch.php	Sun Dec 30 07:00:09 2018 -0500
@@ -95,14 +95,14 @@
         curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
 	$gotit=0;
 	  $semaphore = new SyncSemaphore("Amazon");
-	  $gotit = $semaphore->lock(4000);
+	  $gotit = $semaphore->lock(1000);
 	  file_put_contents('/var/ywww/debug/phpDebug',
 			    "Got it: ".(int)$gotit." 3\n",FILE_APPEND);
-	  if (!$gotit) { $gotit = $semaphore->lock(20000); }
+	  if (!$gotit) { $gotit = $semaphore->lock(1000); }
         $ret = curl_exec($crl);
         curl_close($crl);
 	if ($gotit) {
-	  usleep(1000000);
+	  usleep(500000);
 	  file_put_contents('/var/ywww/debug/phpDebug',"Unlocking 3\n",FILE_APPEND);
 	  $semaphore->unlock();
 	}