From 53bd39eabdd6b03ba3f2d6ccd8810ef92a480b83 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Thu, 24 Sep 2026 16:49:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(workerman):=20=E7=BB=9F=E4=B8=80=20workerma?= =?UTF-8?q?n/timer=20=E8=BF=90=E8=A1=8C=E6=97=B6=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=B0=20runtime=20=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit timer 命令未设置 logFile/statusFile,workerman 回退默认路径导致日志与状态文件写入 vendor/workerman/,现统一指定到 runtime 目录;补充 docker mysql 数据目录忽略规则。 --- .gitignore | 4 ++++ backend/app/command/Timer.php | 2 ++ backend/app/command/Workerman.php | 1 + 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 09c050c7a..d7b0251ef 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ /frontend/uni-app/node_modules/ /frontend/uni-app/.env /frontend/uni-app/.env.development + +#docker +/docker/mysql/data/* +/docker/mysql/log/* diff --git a/backend/app/command/Timer.php b/backend/app/command/Timer.php index 9b0976b5a..7699e4e14 100644 --- a/backend/app/command/Timer.php +++ b/backend/app/command/Timer.php @@ -65,6 +65,8 @@ class Timer extends Command { $this->init($input, $output); Worker::$pidFile = app()->getRootPath() . 'runtime/timer.pid'; + Worker::$logFile = app()->getRootPath() . 'runtime/timer.log'; + Worker::$statusFile = app()->getRootPath() . 'runtime/timer.status'; $task = new Worker(); date_default_timezone_set('PRC'); $task->count = 1; diff --git a/backend/app/command/Workerman.php b/backend/app/command/Workerman.php index d274c87d1..5e1767575 100644 --- a/backend/app/command/Workerman.php +++ b/backend/app/command/Workerman.php @@ -106,6 +106,7 @@ class Workerman extends Command $server = $this->init($input, $output); Worker::$pidFile = app()->getRootPath() . 'runtime/workerman.pid'; Worker::$logFile = app()->getRootPath() . 'runtime/workerman.log'; + Worker::$statusFile = app()->getRootPath() . 'runtime/workerman.status'; if (!$server || $server == 'gateway') { //创建统一长连接网关服务(所有长链接业务共用此端口)