From 83046b402dfde39c2bfe0d9b5740241ea8dd8ba4 Mon Sep 17 00:00:00 2001 From: kang Date: Sat, 16 May 2026 10:52:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E8=84=9A=E6=9C=AC=E4=B8=8E=E5=A4=A7=E5=8E=85?= =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6=E8=B0=83=E5=BA=A6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 默认会话、队列和缓存驱动切换为 Redis 2. 拆分 dev、dev:realtime 和 dev:schedule 脚本,支持按需启动实时与调度进程 3. 新增大厅倒计时调度配置开关,支持关闭每秒广播任务 --- .env.example | 6 +++--- .trae/.ignore | 0 bootstrap/app.php | 4 +++- composer.json | 8 ++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) delete mode 100644 .trae/.ignore diff --git a/.env.example b/.env.example index a240f3b..a4ecfad 100644 --- a/.env.example +++ b/.env.example @@ -80,7 +80,7 @@ DB_PASSWORD= # ============================================================================= # 会话驱动:file / cookie / database / redis 等 -SESSION_DRIVER=database +SESSION_DRIVER=redis # 会话存活时间(分钟) SESSION_LIFETIME=120 # 是否加密会话数据 @@ -114,9 +114,9 @@ FILESYSTEM_DISK=local # ============================================================================= # 队列驱动:sync(同步)/ database / redis 等;本地常用 database -QUEUE_CONNECTION=database +QUEUE_CONNECTION=redis # 缓存存储:file / database / redis 等;与 Redis 赔付池等能力对接前可用 database -CACHE_STORE=database +CACHE_STORE=redis # 缓存键全局前缀;多环境共 Redis 时可用于隔离,一般可留空使用框架默认 # CACHE_PREFIX= diff --git a/.trae/.ignore b/.trae/.ignore deleted file mode 100644 index e69de29..0000000 diff --git a/bootstrap/app.php b/bootstrap/app.php index 12e62f4..d3c3742 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -172,6 +172,8 @@ return Application::configure(basePath: dirname(__DIR__)) ->everyTenMinutes() ->withoutOverlapping(); /** @see docs/01-界面文档.md §2.1 `draw.countdown` */ - $schedule->command('lottery:hall-countdown')->everySecond(); + if (config('lottery.realtime_hall_countdown', true)) { + $schedule->command('lottery:hall-countdown')->everySecond(); + } }) ->create(); diff --git a/composer.json b/composer.json index 25ba79c..6dd0611 100644 --- a/composer.json +++ b/composer.json @@ -48,9 +48,17 @@ "npm run build" ], "dev": [ + "Composer\\Config::disableProcessTimeout", + "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#f472b6\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others" + ], + "dev:realtime": [ "Composer\\Config::disableProcessTimeout", "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74,#34d399,#f472b6\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"php artisan reverb:start\" \"php artisan schedule:work\" \"npm run dev\" --names=server,queue,logs,reverb,schedule,vite --kill-others" ], + "dev:schedule": [ + "Composer\\Config::disableProcessTimeout", + "php artisan schedule:work" + ], "test": [ "@php artisan config:clear --ansi @no_additional_args", "@php artisan test"