docs: .env.example 补齐可选队列/Redis/worker 环境变量说明(doc-only) - #24
Merged
XiaoCow666 merged 1 commit intoSep 8, 2026
Merged
Conversation
XiaoCow666
requested changes
Sep 8, 2026
XiaoCow666
left a comment
Owner
There was a problem hiding this comment.
结论:通过,提供的 diff 中没有必要修改项。
已验证范围:仅静态审阅 .env.example 第 64–88 行新增内容。两个队列配置段、会话 Redis 和 worker 配置档示例全部处于注释状态;原有赋值未变,没有引入生效配置、凭据、业务代码或部署变更,因此未发现运行行为回归。
验证边界:未调用工具或运行测试;未提供 config.py、app.py 和 worker 源码,故无法独立确认描述中的默认值、TTL 范围及降级行为,PR 正文的验证记录仅作为贡献者报告。
后续建议(非阻塞):
.env.example的“能力分析外部队列(约束同上)”可明确写出:选择 rq 时必须配置ABILITY_ANALYSIS_REDIS_URL,减少首次配置时的歧义。- worker 段可将“单机部署通常无需设置”改成“使用默认 production 配置时无需设置”,更准确地表达配置选择条件。
- 当前 PR description 已清楚说明范围与验证边界。后续修改这些示例时,继续记录对应源码位置,并用 diff 确认示例仍全部注释;若实际启用 rq,再单独验证 Redis 连接与 worker 消费链路。本次无需为纯注释变更补跑完整测试。
合并前隔离验证
- 结果:未通过
- 命令:gh repo clone
- 耗时:18079ms
- 摘要:Cloning into 'E:\CodeSense\pr-review-relay\data\work\premerge-9spZBn\repo'...
fatal: unable to access 'https://github.com/XiaoCow666/CodeSense.git/': schannel: failed to receive handshake, SSL/TLS connection failed
failed to run git: exit status 128
合并前验证未通过,本次不合并。请先修复验证输出中指出的问题,再提交新的 head。
XiaoCow666
approved these changes
Sep 8, 2026
XiaoCow666
left a comment
Owner
There was a problem hiding this comment.
结论:通过。提供的 diff 中未发现必要修改项。
已验证范围:仅静态审阅 .env.example 第 64–88 行新增内容。队列、会话 Redis 和 worker 配置示例全部保持注释状态,没有新增生效赋值;diff 未涉及业务代码、数据库、权限或部署文件,因此未见直接改变运行行为的风险。未调用工具或运行测试;PR 描述中的源码核对结果属于贡献者提供的信息,无法仅凭本次 diff 独立确认。
后续建议(不阻塞):
- 在两个
*_QUEUE_TTL附近补充 TTL 的具体含义,依据实现说明它限制的是排队等待时间、执行时间还是结果保留时间,避免部署者误配。 - 将“单机部署通常无需设置”改为“使用默认 production 配置时无需设置”,让说明直接对应配置条件,避免读者按机器数量判断。
本次 PR description 已清楚列出范围、核对位置和未运行测试的原因,无需为合并补跑应用。后续同类 PR 可继续采用这一验证流程:核对变量名、默认值及约束,检查示例是否仍为注释,并在描述中区分静态核对与实际运行验证。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
阶段一项目理解(PR #16、#22,均已合并)将"运行参数模板与代码口径一致"列为待改进项:
config.py 已支持把"非 demo 的提交评测/能力分析"切换到 RQ 外部队列,app.py 支持
会话 Redis 及失败自动降级,独立评测 worker 读取 CODESENSE_CONFIG,但 .env.example
未收录以上任何变量,维护者只能翻代码才能发现这些可配置项。
变更范围(doc-only,仅 .env.example,+25/-0)
_QUEUE_NAME / _QUEUE_TTL(默认 thread;rq 时 _REDIS_URL 必填,否则启动校验失败);
验证命令及结果
rg -n "QUEUE_BACKEND|_REDIS_URL|QUEUE_NAME|QUEUE_TTL" config.pyrg "minimum=30, maximum=86400" config.pyrg "REDIS_URL" app.pyos.environ.get('REDIS_URL') or 'redis://127.0.0.1:6379/0',连接失败降级 filesystem,与注释一致rg "CODESENSE_CONFIG" tasks/*_worker.pygit diff审阅git checkout -b ... origin/main未运行 pytest / 应用:.env.example 是模板而非运行时依赖,不触碰任何被加载的代码路径。
事实与推断边界
tasks/*_worker.py 静态核对(行号见上表)。
工作的代码事实推断,未在真实多机环境验证。
未解决问题与待决策事项(高风险边界,仅记录、不在本 PR 处理)
--bind 8000与 gunicorn_config.py / run.py 默认 5000并存,.env.example 示例为 8000;属部署拓扑决策,改动会触碰部署文件,超出本 PR 边界。
(PR docs: 按 PR #16 评审意见 P3 限定 RQ 迁出范围表述(doc-only) #22 已在项目文档中限定该范围);是否进一步拆分属架构决策。
后续建议
在 AGENTS.md 已有约束,可整合成 docs/deploy-rq.md)。
不修改任何业务代码、数据库结构、权限、部署文件或核心接口。