So I have a script running that checks 720 people for whether they should still have Temaspeak access or not. I know I’ve semi raised this before but I wasn’t so clear.
Using ESI (doesn’t occur using XML), the script falls silent when it’s ESI’s time to speak up. The script just stops dead. But the last line is always my debug print saying it’s making an ESI call.
I’ve been recording it and it always falls over without any error at the same region of calls. Can anyone comment on this?
Hourly attempt # | Result
#1 completed successfully. (1,412 calls)
#2 died without error at call 1,057
#3 died without error at call 1,310
#4 completed successfully. (1,412 calls)
#5 died without error at call 1,176
#6 completed successfully. (1,412 calls)
#7 died without error at call 1,269
#8 died without error at call 1,249
#9 died without error at call 1,259
#10 died without error at call 1,385
#11 died without error at call 1,291
#12 died with cURL timout, no response after 10 seconds at call 61
#13 died without error at call 1,333
#14 died without error at call 1,283
#15 died with cURL timout, no response after 10 seconds at call 401
#16 died without error at call 1,159
#17 died without error at call 1,191
The PHP function calling ESI can’t be to fault if it periodically works surely? If it works even once then that’s proof the function works, ESI isn’t even sending an error to be picked up. Just completely dead. Note that the function doesn’t report zero content being recieved either as that would be handled.
function ESIcall($url) {
// Set constants for cURL
$curlConstants = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_USERAGENT => "EVEOTS Auth",
);
// cURL
$curl = curl_init();
curl_setopt_array($curl, $curlConstants);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
if ($result == false) {
die(curl_error($curl)."[".__LINE__."]");
}
curl_close($curl);
$response = json_decode($result);
if (isset($response->error)) {
die("<p><strong>ESI Error: ".$response->error."</strong> (".$response->error_description.") [".__LINE__."]</p>");
} else if ($response == "") {
die("<p><strong>ESI Error: Response was blank [".__LINE__."]</p>");
}
return $response;
}