This commit is contained in:
wong
2026-01-17 15:42:00 +08:00
parent 51a731ea68
commit 56d5f0b5a3
2 changed files with 5 additions and 4 deletions

View File

@@ -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 文件是否存在

View File

@@ -142,7 +142,7 @@ return [
'command' => 'content:collect',
'schedule' => '*/5 * * * *', // 每5分钟
'options' => [],
'enabled' => true,
'enabled' => false,
'max_concurrent' => 1,
'log_file' => 'crontab_contentCollect.log',
],