Files
ulthon_admin/config/timer.php
augushong 76b23d4c70 refactor(timer): 使用 CurlMultiHandler 替代 Workerman,统一为非阻塞模式
- 删除 runParallel() 方法和所有 Workerman 引用(死代码)
- 重写 runLoop() 为 Guzzle CurlMultiHandler 非阻塞事件循环
- 新增 pending 数组追踪进行中的请求,handler.tick() 非阻塞推进
- 自适应 sleep 策略(有任务 50ms,空闲 200ms)
- 简化 config/timer.php:移除 mode,适配 Guzzle 参数
- 更新 SKILL.md:移除 parallel 描述,修正 --quit 文档 bug
- 验证发现:--quiet 是 ThinkPHP 全局选项,不需要在 configure() 注册
- 验证发现:方法名不能用 run(),与 ThinkPHP Command::run() 签名冲突
2026-06-02 21:19:53 +08:00

20 lines
591 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use think\facade\Env;
// 定时器配置Guzzle CurlMultiHandler 非阻塞模式)
$config = [
// Guzzle Client 连接配置
'connect_timeout' => 30, // 连接超时时间(秒)
'timeout' => 86400, // 请求响应超时时间(秒)
// CurlMultiHandler 配置
'max_handles' => 100, // curl multi 最大并发句柄数
'select_timeout' => 0.001, // curl_multi_select 超时(秒)
// 清理日志保留天数debug_log 表)
'clear_log_days' => Env::get('timer.clear_log_days', 3),
];
return $config;