优化
This commit is contained in:
@@ -396,13 +396,14 @@ class TaskSchedulerCommand extends Command
|
||||
mkdir($logDir, 0755, true);
|
||||
}
|
||||
|
||||
// 使用指定的网站目录作为执行目录
|
||||
$executionPath = '/www/wwwroot/mckb_quwanzhi_com/Server';
|
||||
// 获取项目根目录(使用 __DIR__ 动态获取)
|
||||
// TaskSchedulerCommand.php 位于 application/command/,向上两级到项目根目录
|
||||
$executionPath = dirname(__DIR__, 2);
|
||||
|
||||
// 获取 PHP 可执行文件路径
|
||||
$phpPath = PHP_BINARY ?: 'php';
|
||||
|
||||
// 获取 think 脚本路径(使用执行目录)
|
||||
// 获取 think 脚本路径(使用项目根目录)
|
||||
$thinkPath = $executionPath . DIRECTORY_SEPARATOR . 'think';
|
||||
|
||||
// 检查 think 文件是否存在
|
||||
|
||||
@@ -142,7 +142,7 @@ return [
|
||||
'command' => 'content:collect',
|
||||
'schedule' => '*/5 * * * *', // 每5分钟
|
||||
'options' => [],
|
||||
'enabled' => true,
|
||||
'enabled' => false,
|
||||
'max_concurrent' => 1,
|
||||
'log_file' => 'crontab_contentCollect.log',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user