From eb3cff5b3adb47b9d8918c021247e5c36cdb7bea Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 19 Mar 2021 03:43:21 -0400 Subject: [PATCH] LibreOffice: Remove unnecessary callbackification `async.queue` will do the right thing if passed an `async` function. --- src/node/utils/LibreOffice.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/node/utils/LibreOffice.js b/src/node/utils/LibreOffice.js index 5fcfa3acc..276bc3003 100644 --- a/src/node/utils/LibreOffice.js +++ b/src/node/utils/LibreOffice.js @@ -74,10 +74,7 @@ const doConvertTask = async (task) => { }; // Conversion tasks will be queued up, so we don't overload the system -const queue = async.queue( - // For some reason util.callbackify() throws "TypeError [ERR_INVALID_ARG_TYPE]: The last - // argument must be of type Function. Received type object" on Node.js 10.x. - (task, cb) => doConvertTask(task).then(() => cb(), (err) => cb(err || new Error(err))), 1); +const queue = async.queue(doConvertTask, 1); /** * Convert a file from one type to another