| 231 | const SCAN_FLUSH_BATCH = 400; |
| 232 | |
| 233 | const flushDiscoveredFiles = (force = false) => { |
| 234 | while (files.length >= SCAN_FLUSH_BATCH || (force && files.length > 0)) { |
| 235 | const chunk = files.splice(0, Math.min(SCAN_FLUSH_BATCH, files.length)); |
| 236 | parentPort.postMessage({ type: 'batch', files: chunk }); |
| 237 | } |
| 238 | }; |
| 239 | |
| 240 | const shouldQueueFile = (fileName) => { |
| 241 | // Skip Printventory zip-extract temps if they somehow land under a scanned tree |
| 242 | if (typeof fileName === 'string' && fileName.startsWith('printventory_')) return false; |
| 243 | const ext = path.extname(fileName).toLowerCase(); |
| 244 | if (extSet.has(ext)) return true; |