From 56d5f0b5a3384efc70aa96b7e327e9a0087ecbc5 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Sat, 17 Jan 2026 15:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/command/TaskSchedulerCommand.php | 7 ++++--- Server/config/task_scheduler.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Server/application/command/TaskSchedulerCommand.php b/Server/application/command/TaskSchedulerCommand.php index 3e6edba2..943bfbfc 100644 --- a/Server/application/command/TaskSchedulerCommand.php +++ b/Server/application/command/TaskSchedulerCommand.php @@ -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 文件是否存在 diff --git a/Server/config/task_scheduler.php b/Server/config/task_scheduler.php index eab1e5b7..8e189c55 100644 --- a/Server/config/task_scheduler.php +++ b/Server/config/task_scheduler.php @@ -142,7 +142,7 @@ return [ 'command' => 'content:collect', 'schedule' => '*/5 * * * *', // 每5分钟 'options' => [], - 'enabled' => true, + 'enabled' => false, 'max_concurrent' => 1, 'log_file' => 'crontab_contentCollect.log', ],