fix(agent): restrict pageCount and duration recommendations to matching media types (#397)

This commit is contained in:
Yiling-J
2026-09-08 14:52:37 +08:00
committed by GitHub
parent 04fd571bd9
commit 4a61e87a27
5 changed files with 183 additions and 10 deletions
+5 -1
View File
@@ -232,9 +232,13 @@ export class S3StorageService implements S3Service {
return
}
const writeStream = fs.createWriteStream(filePath)
try {
await pipeline(res.Body as unknown as NodeJS.ReadableStream, fs.createWriteStream(filePath))
await pipeline(res.Body as unknown as NodeJS.ReadableStream, writeStream)
} catch (err) {
if (!writeStream.closed) {
await new Promise((resolve) => writeStream.once('close', resolve))
}
await fs.promises.unlink(filePath).catch(() => {})
throw err
}