fix(dingtalk): avoid hanging on file download write

This commit is contained in:
Hua
2026-03-16 09:58:11 +08:00
parent e2bbdb7a4f
commit ae8db846e6

View File

@@ -556,7 +556,7 @@ class DingTalkChannel(BaseChannel):
download_dir = get_media_dir("dingtalk") / sender_id download_dir = get_media_dir("dingtalk") / sender_id
download_dir.mkdir(parents=True, exist_ok=True) download_dir.mkdir(parents=True, exist_ok=True)
file_path = download_dir / filename file_path = download_dir / filename
await asyncio.to_thread(file_path.write_bytes, file_resp.content) file_path.write_bytes(file_resp.content)
logger.info("DingTalk file saved: {}", file_path) logger.info("DingTalk file saved: {}", file_path)
return str(file_path) return str(file_path)
except Exception as e: except Exception as e: