Dead processes will be deleted when they are running for more than 9 minutes.
This commit is contained in:
@@ -37,9 +37,15 @@ function cronhooks_run(&$argv, &$argc){
|
||||
|
||||
$lockpath = get_config('system','lockpath');
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'cron.lck');
|
||||
$pidfile = new pidfile($lockpath, 'cronhooks');
|
||||
if($pidfile->is_already_running()) {
|
||||
logger("cronhooks: Already running");
|
||||
if ($pidfile->running_time() > 9*60) {
|
||||
$pidfile->kill();
|
||||
logger("cronhooks: killed stale process");
|
||||
// Calling a new instance
|
||||
proc_run('php','include/cronhooks.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -52,8 +58,6 @@ function cronhooks_run(&$argv, &$argc){
|
||||
|
||||
$d = datetime_convert();
|
||||
|
||||
set_time_limit(9*60*60); // Setting the maximum execution time for cronjobs to 9 minutes.
|
||||
|
||||
call_hooks('cron', $d);
|
||||
|
||||
logger('cronhooks: end');
|
||||
|
||||
Reference in New Issue
Block a user