feat: 添加 TODO 注释以优化内存管理和异步处理

This commit is contained in:
2026-04-26 01:40:03 +08:00
parent 818cf317ab
commit be4c27532f
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -126,6 +126,8 @@ const downloadImage = async (imageUrl: string) => {
throw new Error(`图片下载失败:${response.status}`);
}
// TODO: 当前会把整张图片一次性读入当前 Node 进程内存,再转 Blob 上传到图床;
// 如果图片尺寸或并发继续增大,建议改成流式转发或落临时文件,降低内存峰值和主线程抖动。
return {
bytes: await response.arrayBuffer(),
mimeType: response.headers.get("content-type") || "image/png"