dy-dashboard/vault/知识库/工作指南/训练记录/2026-06-26-修复auto_update钉盘下载功能.md
2026-10-28 11:14:17 +08:00

17 lines
637 B
Markdown
Raw 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.

# 2026-06-26 修复auto_update.py钉盘下载功能
## 背景
`auto_update.py` 的 `download_from_dingtalk()` 函数只有扫描钉盘文件(`dws drive list`)的逻辑,没有实际下载文件(`dws drive download`)的实现,导致新电脑上 `tmp_csv/` 目录为空,自动更新无法导入数据。
## 修复
重写 `download_from_dingtalk()` 函数,添加内嵌 `_download_files()` 辅助函数:
1. 扫描钉盘指定文件夹
2. 检查本地 `tmp_csv/` 是否已有同名文件
3. 无则调用 `dws drive download` 下载,有则跳过
## 涉及文件
- `auto_update.py`(`download_from_dingtalk` 函数)