本文整理汇总了PHP中Scheduler::checkPendingJobs方法的典型用法代码示例。如果您正苦于以下问题:PHP Scheduler::checkPendingJobs方法的具体用法?PHP Scheduler::checkPendingJobs怎么用?PHP Scheduler::checkPendingJobs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scheduler
的用法示例。
在下文中一共展示了Scheduler::checkPendingJobs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testcheckPendingJobs
public function testcheckPendingJobs()
{
$scheduler = new Scheduler();
//execute the method and test if it works and does not throws an exception.
try {
$scheduler->checkPendingJobs(new SugarJobQueue());
$this->assertTrue(true);
} catch (Exception $e) {
$this->fail();
}
}
示例2: array
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
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// EXECUTE IF VALID TIME (NOT DDOS)
if ($timestamp[0] < strtotime(date('H:i'))) {
if (is_writable($cachePath . '/' . $pid)) {
write_array_to_file('timestamp', array(strtotime(date('H:i'))), $cachePath . '/' . $pid);
require 'modules/Schedulers/Scheduler.php';
$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);
示例3: runSchedulers
/**
* Run schedulers to instantiate scheduled jobs
*/
public function runSchedulers()
{
$sched = new Scheduler();
$sched->checkPendingJobs($this);
}