« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/node-utils.js5
1 files 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 [];