|
@@ -26,17 +26,17 @@ class Kernel{
|
|
|
*/
|
|
|
public function schedule()
|
|
|
{
|
|
|
- $this->command('DemoTime','1','minute');// 默认间隔1分钟触发 daily 单位分钟
|
|
|
+ $this->command(DemoTime::class,'1','minute');// 默认间隔1分钟触发 daily 单位分钟
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 定时任务触发时间
|
|
|
- * @param string $class
|
|
|
+ * @param $class
|
|
|
* @param string $daily
|
|
|
* @param string $type
|
|
|
* @return false|\think\console\Output
|
|
|
*/
|
|
|
- private function command(string $class,string $daily = '',string $type = 'minute')
|
|
|
+ private function command($class,string $daily = '',string $type = 'minute')
|
|
|
{
|
|
|
// 按分钟、按每天指定点数
|
|
|
if (!in_array($type,['minute','at'])) {
|
|
@@ -62,6 +62,6 @@ class Kernel{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return Console::call($class);
|
|
|
+ return (new $class)->execute();
|
|
|
}
|
|
|
}
|