This commit is contained in:
david 2021-03-05 21:20:00 +08:00
parent f093b54596
commit 7823ce3f36
3 changed files with 11 additions and 12 deletions

View File

@ -7,7 +7,6 @@ use app\common\exception\BusinessException;
use app\common\Config as Conf;
use app\common\Constant;
use app\domain\Config;
use app\domain\Crontab;
/**
* Class Status
* @package app\controller
@ -40,7 +39,7 @@ class Status extends BaseController
public function welcome(Request $request): Response
{
$rs = self::RS;
$cron = Crontab::crontabConfig();
$cron = Config::getCrontab();
$user_sites = Config::getUserSites();
$sites = Config::getSites();
$clients = Config::getClients();

View File

@ -180,6 +180,15 @@ class Config
return Conf::get(self::filename['clients'], Constant::config_format, []);
}
/**
* 计划任务
* @return array
*/
public static function getCrontab():array
{
return Conf::get(self::filename['crontab'], Constant::config_format, []);
}
/**
* 目录
* @return array

View File

@ -74,7 +74,7 @@ class Crontab
});
// 初始化计划任务文件[不同平台的配置会造成command错误需要重新解析命令]
$cron = self::crontabConfig();
$cron = Config::getCrontab();
array_walk($cron, function ($v, $k){
self::createHock($v);
});
@ -297,15 +297,6 @@ class Crontab
return is_bool($ret) ? $ret : ($ret >= 10 ? true : false);
}
/**
* 用户Cron配置
* @return array
*/
public static function crontabConfig():array
{
return Conf::get(Config::filename['crontab'], Constant::config_format, []);
}
/**
* 异步执行命令
* @descr 原理为php的程序执行函数后台执行