新增调度中心

This commit is contained in:
JaguarJack
2020-07-10 08:35:14 +08:00
parent 6db13b9eab
commit 87ec38d1dd
5 changed files with 51 additions and 8 deletions

View File

@@ -53,6 +53,11 @@ class Master
*/
protected $master_pid;
/**
* @var string
*/
protected $kernel;
/**
* pid 文件名称
*
@@ -135,10 +140,8 @@ class Master
protected function schedule()
{
return function () {
$schedule = new Schedule();
$schedule->command('catch:cache')->everyThirtySeconds();
foreach ($schedule->getCronTask() as $cron) {
$kernel = new $this->kernel;
foreach ($kernel->tasks() as $cron) {
if ($cron->can()) {
list($waiting, $process) = $this->hasWaitingProcess();
if ($waiting) {
@@ -253,6 +256,8 @@ class Master
file_put_contents($this->getSaveProcessStatusFile(), '');
$this->createTable();
$this->kernel = config('catch.schedule.schedule_kernel');
}
/**