From bcc183d5b921344782093ab0eb240e85d7c43540 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 11 Jun 2023 01:17:37 +0200 Subject: [PATCH] Using native stream promises for media stream retrieval. --- src/media.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/media.js b/src/media.js index 8ab17b23..cf5363a6 100755 --- a/src/media.js +++ b/src/media.js @@ -24,7 +24,7 @@ const bulkInsert = require('./utils/bulk-insert'); const chunk = require('./utils/chunk'); const { get } = require('./utils/qu'); -const pipeline = util.promisify(stream.pipeline); +// const pipeline = util.promisify(stream.pipeline); const streamQueue = taskQueue(); const endpoint = new AWS.Endpoint('s3.eu-central-1.wasabisys.com'); @@ -629,7 +629,8 @@ streamQueue.define('fetchStreamSource', async ({ source, tempFileTarget, hashStr .on('error', (error) => logger.error(`Failed to fetch stream from ${source.stream}: ${error.message}`)) .pipe(); - await pipeline(video, hashStream, tempFileTarget); + // await pipeline(video, hashStream, tempFileTarget); + await stream.promises.pipeline(video, hashStream, tempFileTarget); logger.verbose(`Finished fetching stream from ${source.stream}`);