From 25d492fac5daf1b9a983792df06af41ecd8c3424 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 20 Dec 2025 18:57:17 -0400 Subject: node-utils: traverse: queue stat too --- src/node-utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node-utils.js b/src/node-utils.js index d2e29b2f..8b81053d 100644 --- a/src/node-utils.js +++ b/src/node-utils.js @@ -83,12 +83,13 @@ export async function traverse(rootPath, { throw new Error(`Expected pathStyle to be device, posix, or win32`); } - const q_readdir = wrapQueue(readdir, queueSize); + const q_readdir = wrapQueue(readdir, Math.ceil(queueSize / 2)); + const q_stat = wrapQueue(stat, Math.ceil(queueSize / 2)); const recursive = (names, ...subdirectories) => Promise.all(names.map(async name => { const devicePath = pathJoinDevice(rootPath, ...subdirectories, name); - const stats = await stat(devicePath); + const stats = await q_stat(devicePath); if (stats.isDirectory() && !filterDir(name)) return []; else if (stats.isFile() && !filterFile(name)) return []; -- cgit 1.3.0-6-gf8a5