private function _triggerTasksNow()
{
$url = UrlHelper::getActionUrl('tasks/runPendingTasks');
if (function_exists('curl_init')) {
$ch = curl_init($url);
$options = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => false, CURLOPT_NOSIGNAL => true);
if (defined('CURLOPT_TIMEOUT_MS')) {
$options[CURLOPT_TIMEOUT_MS] = 500;
} else {
$options[CURLOPT_TIMEOUT] = 1;
}
curl_setopt_array($ch, $options);
curl_exec($ch);
$curlErrorNo = curl_errno($ch);
$curlError = curl_error($ch);
$httpStatus = intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
curl_close($ch);
if ($curlErrorNo !== 0) {
ImagerPlugin::log("Request for running tasks immediately failed with error number {$curlErrorNo} and error message: {$curlError}", LogLevel::Error);
}
if ($httpStatus !== 200) {
ImagerPlugin::log("Request for running tasks immediately failed with http status {$httpStatus}", LogLevel::Error);
}
}
}