新增调度中心
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -103,9 +103,7 @@ trait RegisterSignal
|
||||
foreach ($this->processes as $pid => $process) {
|
||||
Process::kill($pid, SIGUSR1);
|
||||
}
|
||||
|
||||
usleep(100);
|
||||
|
||||
$this->saveProcessStatus();
|
||||
};
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ trait Store
|
||||
public function output()
|
||||
{
|
||||
// 等待信号输出
|
||||
usleep(500);
|
||||
sleep(1);
|
||||
|
||||
return $this->getProcessStatusInfo();
|
||||
}
|
||||
|
Reference in New Issue
Block a user