fix(s3): ensure downloadToFile uses Bun.write for streaming

This commit is contained in:
yiling
2026-06-08 20:04:13 +08:00
parent 38909b2bab
commit 24c279318a
+1 -2
View File
@@ -125,8 +125,7 @@ export class S3StorageService implements S3Service {
async downloadToFile(bucket: string, key: string, filePath: string): Promise<void> {
const file = this.client.file(key, { bucket })
const arrayBuffer = await file.arrayBuffer()
await fs.promises.writeFile(filePath, Buffer.from(arrayBuffer))
await Bun.write(filePath, file)
}
async deleteObject(bucket: string, key: string): Promise<number> {