comparison php/read/similar.php @ 52:d9dd9705e724

wait longer
author Charlie Root
date Thu, 06 Jun 2019 16:33:34 -0400
parents d606320ec331
children
comparison
equal deleted inserted replaced
51:e6976d92cfc9 52:d9dd9705e724
106 curl_setopt ($crl, CURLOPT_URL,$url); 106 curl_setopt ($crl, CURLOPT_URL,$url);
107 curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); 107 curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
108 curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); 108 curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
109 $gotit=0; 109 $gotit=0;
110 $semaphore = new SyncSemaphore("Amazon"); 110 $semaphore = new SyncSemaphore("Amazon");
111 $gotit = $semaphore->lock(1000); 111 $gotit = $semaphore->lock(5000);
112 if (!$gotit) { 112 if (!$gotit) {
113 file_put_contents('/var/ywww/debug/phpDebug', 113 file_put_contents('/var/ywww/debug/phpDebug',
114 "Got it: ".(int)$gotit." 4\n",FILE_APPEND); 114 "Got it: ".(int)$gotit." 4\n",FILE_APPEND);
115 $gotit = $semaphore->lock(1000); 115 $gotit = $semaphore->lock(5000);
116 file_put_contents('/var/ywww/debug/phpDebug', 116 file_put_contents('/var/ywww/debug/phpDebug',
117 "Got it: ".(int)$gotit." 4a\n",FILE_APPEND); 117 "Got it: ".(int)$gotit." 4a\n",FILE_APPEND);
118 } 118 }
119 $ret = curl_exec($crl); 119 $ret = curl_exec($crl);
120 curl_close($crl); 120 curl_close($crl);
121 usleep(500000); 121 usleep(1000000);
122 if ($gotit) { 122 if ($gotit) {
123 $semaphore->unlock(); 123 $semaphore->unlock();
124 } 124 }
125 else { 125 else {
126 file_put_contents('/var/ywww/debug/phpDebug', 126 file_put_contents('/var/ywww/debug/phpDebug',