aaronsb_obsidian-mcp-plugin/build-worker.js
Aaron Bockelie 22742bd75c feat: Add worker threads for true concurrent processing (v0.5.8b)
- Implement worker threads per session for CPU-intensive operations
- Offload graph traversal and search operations to workers
- Fix concurrent session blocking with proper parallelization
- Add WorkerManager for session-based worker lifecycle
- Update build process to compile worker scripts

This release (0.5.8b) enables true concurrent processing by running
operations in separate worker threads, preventing blocking between
multiple MCP clients.
2025-07-05 17:54:49 -05:00

26 lines
No EOL
810 B
JavaScript
Executable file

#!/usr/bin/env node
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
console.log('Building worker scripts...');
const workerSrcDir = path.join(__dirname, 'src', 'workers');
const workerDistDir = path.join(__dirname, 'dist', 'workers');
// Create dist/workers directory if it doesn't exist
if (!fs.existsSync(workerDistDir)) {
fs.mkdirSync(workerDistDir, { recursive: true });
}
// Compile TypeScript worker files
try {
execSync(`npx tsc src/workers/*.ts --outDir dist/workers --module commonjs --target es2020 --lib es2020 --skipLibCheck --types node`, {
stdio: 'inherit'
});
console.log('✅ Worker scripts built successfully');
} catch (error) {
console.error('❌ Failed to build worker scripts:', error.message);
process.exit(1);
}