Files
ulthon_admin/config/timer.php
augushong f478ae0e4e feat(timer): runLoop 热加载并发实例与运行时配置参数
TimerBase 实现 shouldExecuteTask 手动触发原子消费、reloadRequestList 合并式扩缩容、runLoop 脏标记检测+定时兜底+有效域钳制+drain 优雅缩容+checkTriggerTtl 超时复位。config/timer.php 新增 trigger_ttl/force_reload_interval/drain_max_lifetime 三参数。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-25 21:57:25 +08:00

28 lines
1.2 KiB
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 超时(秒)
// T6: runLoop 热加载配置
'force_reload_interval' => (int) Env::get('timer.force_reload_interval', 15), // 兜底 reload 间隔(秒),防 cache 丢失导致脏标记漏检
'trigger_ttl' => (int) Env::get('timer.trigger_ttl', 300), // 手动触发 TTL超时未消费自动复位 manual_trigger
// 清理日志保留天数debug_log 表)
'clear_log_days' => Env::get('timer.clear_log_days', 3),
// T7: drain 最长存活上限draining 实例超过该时长强制移除(防永不 drain
// 默认与任务 timeout 一致86400s可通过 .env timer.drain_max_lifetime 覆盖
'drain_max_lifetime' => (int) Env::get('timer.drain_max_lifetime', 86400),
];
return $config;