WIP: schedulers..
This commit is contained in:
9
cron.php
9
cron.php
@@ -68,7 +68,6 @@ $current_user->getSystemUser();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// PREP FOR SCHEDULER PID
|
||||
$GLOBALS['log']->debug('--------------------------------------------> at cron.php <--------------------------------------------');
|
||||
|
||||
$cachePath = $GLOBALS['sugar_config']['cache_dir'].'modules/Schedulers';
|
||||
$pid = 'pid.php';
|
||||
@@ -79,14 +78,10 @@ if(!is_file($cachePath.'/'.$pid)) {
|
||||
if(is_writable($cachePath)) { // the "file" does not yet exist
|
||||
write_array_to_file('timestamp', array(strtotime(date('H:i'))) , $cachePath.'/'.$pid);
|
||||
require_once($cachePath.'/'.$pid);
|
||||
} else {
|
||||
$GLOBALS['log']->fatal('Scheduler cannot write PID file. Please check permissions on '.$cachePath);
|
||||
}
|
||||
} else {
|
||||
if(is_writable($cachePath.'/'.$pid)) {
|
||||
require_once($cachePath.'/'.$pid);
|
||||
} else {
|
||||
$GLOBALS['log']->fatal('Scheduler cannot read the PID file. Please check permissions on '.$cachePath);
|
||||
}
|
||||
}
|
||||
//// END PREP FOR SCHEDULER PID
|
||||
@@ -102,11 +97,7 @@ if($timestamp[0] < strtotime(date('H:i'))) {
|
||||
$s = new Scheduler();
|
||||
$s->flushDeadJobs();
|
||||
$s->checkPendingJobs();
|
||||
} else {
|
||||
$GLOBALS['log']->fatal('Scheduler cannot write PID file. Please check permissions on '.$cachePath);
|
||||
}
|
||||
} else {
|
||||
$GLOBALS['log']->fatal('If you see a whole string of these, there is a chance someone is attacking your system.');
|
||||
}
|
||||
$exit_on_cleanup = true;
|
||||
sugar_cleanup($exit_on_cleanup);
|
||||
|
||||
Reference in New Issue
Block a user