fix(dingtalk): avoid hanging on file download write
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user