Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

close() stops the attachment uploader without uploading pending attachments

已关闭 适合新手
#62 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

从 wildedge/client.py:1000 开始,其中 WildEdge.close() 会停止 uploader,然后检查 wildedge/attachments.py 中的 AttachmentUploader.stop() 和 process_pending()。跟踪 close(timeout=...) 和 flush(timeout=...) 如何将超时状态传递给 uploader。当最后一个待处理上传在剩余超时时间内运行时,问题即视为完成;同时,无超时的关闭操作应保持当前行为,并为关闭时处于待处理状态的附件添加回归测试。

由索引模型根据 Issue 内容生成。

描述

What happens

WildEdge.close() (wildedge/client.py:1000) calls AttachmentUploader.stop() (wildedge/attachments.py), which only sets the stop event and joins the thread. The uploader runs process_pending() every DEFAULT_ATTACHMENT_FLUSH_INTERVAL_SEC (5 s), so attachments registered in the last few seconds before shutdown are not uploaded. close(timeout=...) flushes events but not attachments.

They stay in the on-disk store and go out on the next start, if there is one and they are still within max_age_s. For short-lived processes (CLI runs, scripts, a kiosk app stopped with Ctrl-C) this means the last exchanges' attachments are missing, while their events reference them (attachment_count > 0).

Verified: after close(timeout=1.5) the attachments were missing; calling client.attachment_uploader.process_pending() manually before close uploaded them.

Expected

When close(timeout=...) / flush(timeout=...) is given a timeout, run a final process_pending() (bounded by the remaining timeout) before stopping the thread. Without a timeout, keep today's fast shutdown.

SDK 0.2.2.

🤖 Generated with Claude Code

主要语言
Python
星标
17
派生
1
平均合并
17 小时 5 分钟
30 天内合并 PR
34

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wild-edge/wildedge-python 的其他 Issue

查看 wild-edge/wildedge-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。