added non blocking timeout exceptions

This commit is contained in:
Devin Smith 2015-03-02 14:30:15 -08:00
parent 5be792efd4
commit c348e10a04

View File

@ -165,7 +165,14 @@ class Cana extends Cana_Model {
$cmd = c::config()->dirs->root.'cli/timeout-'.$v.'.php'.$sleep.' -c='.str_replace("'",'"',escapeshellarg($encoded)) . $env;
if ($async) {
exec('nohup '.$cmd.' >> /var/log/timeout 2>&1 &');
try {
exec('nohup '.$cmd.' >> /var/log/timeout 2>&1 &');
} catch (Exception $e) {
Crunchbutton_Log::error([
'type' => 'timeout exception',
'cmd' => $cmd
]);
}
} else {
exec($cmd.' 2>&1 &', $o);
print_r($o);