Mercurial > hg > ywww
comparison php/read/similar.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 | d9dd9705e724 |
comparison
equal
deleted
inserted
replaced
22:69c37b58d091 | 23:d606320ec331 |
---|---|
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(4000); | 111 $gotit = $semaphore->lock(1000); |
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(5000); | 115 $gotit = $semaphore->lock(1000); |
116 file_put_contents('/var/ywww/debug/phpDebug', | 116 file_put_contents('/var/ywww/debug/phpDebug', |
117 "Got it: ".(int)$gotit." $requestIP 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(1000000); | 121 usleep(500000); |
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', |