feat: add admin endpoints for process management and improve error handling

- Introduced `/api/admin/restart` and `/api/admin/shutdown` endpoints in WorkerService for restarting and shutting down the service.
- Updated error message in hook-error-handler to provide clearer instructions for restarting the worker.
- Refactored worker-utils to remove PM2 dependency and implement ProcessManager for starting the worker service.
- Cleaned up legacy PM2 references and provided new manual start instructions.
This commit is contained in:
Alex Newman
2025-12-10 23:46:17 -05:00
parent 8bf22b3dc5
commit 83b0f9551b
11 changed files with 159 additions and 247 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ export function handleWorkerError(error: any): never {
error.name === 'TimeoutError' ||
error.message?.includes('fetch failed')) {
throw new Error(
"There's a problem with the worker. If you just updated, type `pm2 restart claude-mem-worker` in your terminal to continue"
"There's a problem with the worker. Try: npm run worker:restart"
);
}
throw error;