perf(scanner): ottimizza scansione destinazione con pass unico e barra determinata
Sostituisce le due scansioni sequenziali (cartelle + file CAD) con un unico passaggio parallelo in services/destinationScanner.js. La lettura di primo livello fornisce il totale delle sezioni, rendendo la barra di progresso determinata (N / totale) durante l'analisi della destinazione. Il label mostra contemporaneamente sezioni completate e file CAD trovati
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const { getDestinationDecision, getCadInfo } = require('./router');
|
||||
const { buildDestinationIndex } = require('./destinationIndex');
|
||||
const { buildExistingCadKeyIndex, toCadKey } = require('./duplicateIndex');
|
||||
const { buildDestinationIndexes, toCadKey } = require('./destinationScanner');
|
||||
const { prepareUnroutedTarget, prepareDuplicateTarget, getSkippedTarget } = require('./unrouted');
|
||||
|
||||
function parseNumericVersion(version) {
|
||||
@@ -70,8 +69,7 @@ async function processFolder(folder, config, onProgress) {
|
||||
onProgress?.({ phase: 'scan' });
|
||||
const files = await collectFilesRecursively(folder);
|
||||
|
||||
const destinationIndex = await buildDestinationIndex(config?.destination, onProgress);
|
||||
const existingCadKeys = await buildExistingCadKeyIndex(config?.destination, onProgress);
|
||||
const { folderIndex: destinationIndex, cadKeyIndex: existingCadKeys } = await buildDestinationIndexes(config?.destination, onProgress);
|
||||
const sourceMaxVersions = buildHighestNumericVersionByCadKey(files);
|
||||
const result = {
|
||||
scanned: 0,
|
||||
|
||||
Reference in New Issue
Block a user