Files
junhong_cmp_fiber/.sisyphus/notepads/realname-trigger-priority-enhancement/decisions.md
huang 7308afe801
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m18s
归档
2026-04-13 15:03:02 +08:00

1.1 KiB
Raw Blame History

架构决策记录

goroutine context 设计(已确认)

  • 必须使用 context.WithTimeout(context.Background(), 3*time.Second) 创建独立 context
  • 禁止复用 c.UserContext()Fiber 请求 context 在 handler 返回后立即失效)
  • goroutine 只接受标量参数uint、string不捕获 *fiber.Ctx 或任何指针

系统用户身份(已确认)

  • 使用 UserTypePlatform 而非 UserTypeSuperAdmin
  • Platform 用户仍受 500次/天日限制约束
  • SuperAdmin 不受日限制约束(不符合要求)

配置结构体命名(已确认)

  • 新增 PollingAutoTriggerConfig 结构体
  • Config 中字段名:PollingAutoTrigger PollingAutoTriggerConfig
  • YAML key: polling_auto_trigger
  • 环境变量前缀:JUNHONG_POLLING_AUTO_TRIGGER_

配置验证(已确认)

  • 不在 Validate() 中添加校验
  • 零值false/0是合法默认值

原子提交策略(已确认)

  • Commit 1: config 文件
  • Commit 2: service bug fix + redis 注释
  • Commit 3: handler 集成(此时全量 build 暂时报错)
  • Commit 4: DI 接线(修复全量 build