Refactor worker port handling and improve logging

- Replaced hardcoded migration port with dynamic port retrieval using `getWorkerPort()` in worker-cli.ts.
- Updated context generator to clarify error handling comments.
- Introduced timeout constants in ProcessManager for better maintainability.
- Configured SQLite settings using constants for mmap size and cache size in DatabaseManager.
- Added timeout constants for Git and NPM commands in BranchManager.
- Enhanced error logging in FormattingService and SearchManager to provide more context on failures.
- Removed deprecated silentDebug function and replaced its usage with logger.debug.
- Updated tests to use dynamic worker port retrieval instead of hardcoded values.
This commit is contained in:
Alex Newman
2025-12-11 14:49:47 -05:00
parent 83b0f9551b
commit ded9671a82
26 changed files with 283 additions and 235 deletions
+2 -5
View File
@@ -1,11 +1,8 @@
import { ProcessManager } from '../services/process/ProcessManager.js';
// During migration, use port 38888 to run alongside the PM2-managed worker on 37777
// Once migration is complete (Phase 3+), this will switch to using settings
const MIGRATION_PORT = 38888;
import { getWorkerPort } from '../shared/worker-utils.js';
const command = process.argv[2];
const port = MIGRATION_PORT;
const port = getWorkerPort();
async function main() {
switch (command) {