Skip to content

fix: avoid mutable default in ContextVar and safely retrieve tasks - #964

Open
aoright wants to merge 1 commit into
NanmiCoder:mainfrom
aoright:fix/avoid-mutable-contextvar-default
Open

fix: avoid mutable default in ContextVar and safely retrieve tasks#964
aoright wants to merge 1 commit into
NanmiCoder:mainfrom
aoright:fix/avoid-mutable-contextvar-default

Conversation

@aoright

@aoright aoright commented Aug 14, 2026

Copy link
Copy Markdown

变更说明

  1. 避免 ContextVar 使用可变对象作为默认值:将 var.py 中的 comment_tasks_var 默认值从可变列表 default=[] 改为 default=None,避免在多个异步上下文之间意外共享和修改同一列表实例。
  2. 安全获取任务列表:在 media_platform/kuaishou/core.py 中使用 comment_tasks_var.get() or [] 安全提取当前运行任务。
  3. 代码清理:清理 tools/time_util.py 中未使用的异常捕获变量和多余的 pass 语句。

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
@aoright
aoright requested a review from NanmiCoder as a code owner August 14, 2026 09:04
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant