Dead processes will be deleted when they are running for more than 9 minutes.
This commit is contained in:
@@ -43,9 +43,15 @@ function poller_run(&$argv, &$argc){
|
||||
|
||||
$lockpath = get_config('system','lockpath');
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'poller.lck');
|
||||
$pidfile = new pidfile($lockpath, 'poller');
|
||||
if($pidfile->is_already_running()) {
|
||||
logger("poller: Already running");
|
||||
if ($pidfile->running_time() > 9*60) {
|
||||
$pidfile->kill();
|
||||
logger("poller: killed stale process");
|
||||
// Calling a new instance
|
||||
proc_run('php','include/poller.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user