MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / mainThread

Function mainThread

scripts/useless-key-scanner.mjs:116–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116async function mainThread() {
117 console.log("process.argv:", process.argv);
118 const database = new Database(LANGUAGE_DIR, LANGUAGE_SOURCE_FILE_NAME);
119 const scannedFiles = await scanCodeFiles(CODE_DIR, [], EXCLUDE_FILES);
120 console.log(`Scanned files (${INCLUDE_EXT_NAMES}):`, scannedFiles.length);
121 const promises = [];
122 for (let i = 0; i < scannedFiles.length; i += CONCURRENT_COUNT) {
123 const filesPath = scannedFiles.slice(i, i + CONCURRENT_COUNT);
124 promises.push(startThread(database.keysMap, filesPath, database));
125 }
126 await Promise.all(promises);
127 console.log("Rewrite source lang file...");
128 await database.rewriteSourceLangFile();
129 console.log("Rewrite source lang file finished!");
130 process.exit(0);
131}
132
133async function worker() {
134 /** @type {Array<string>} */

Callers 1

Calls 6

rewriteSourceLangFileMethod · 0.95
scanCodeFilesFunction · 0.85
startThreadFunction · 0.85
logMethod · 0.80
pushMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected