c46e4a341a
This fixes memory leak, will remove one unnecessary MCP after this in a new PR but this is mission critical fix * Initial plan * Fix memory leaks: Add proper cleanup for ChromaSync and search server processes Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com> * Add comprehensive process cleanup and PM2 configuration improvements Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com> * Add comprehensive summary and recommendations for memory leak fixes Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
/**
|
|
* PM2 Ecosystem Configuration for claude-mem Worker Service
|
|
*
|
|
* Usage:
|
|
* pm2 start ecosystem.config.cjs
|
|
* pm2 stop claude-mem-worker
|
|
* pm2 restart claude-mem-worker
|
|
* pm2 logs claude-mem-worker
|
|
* pm2 status
|
|
*/
|
|
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'claude-mem-worker',
|
|
script: './plugin/scripts/worker-service.cjs',
|
|
// INTENTIONAL: Watch mode enables auto-restart on plugin updates
|
|
//
|
|
// Why this is enabled:
|
|
// - When you run `npm run sync-marketplace` or rebuild the plugin,
|
|
// files in ~/.claude/plugins/marketplaces/thedotmack/ change
|
|
// - Watch mode detects these changes and auto-restarts the worker
|
|
// - Users get the latest code without manually running `pm2 restart`
|
|
//
|
|
// This is a feature, not a bug - it ensures users always run the
|
|
// latest version after plugin updates.
|
|
watch: true,
|
|
ignore_watch: [
|
|
'node_modules',
|
|
'logs',
|
|
'*.log',
|
|
'*.db',
|
|
'*.db-*',
|
|
'.git',
|
|
'vector-db', // Ignore Chroma vector DB files
|
|
'.claude-mem' // Ignore data directory
|
|
],
|
|
// Allow extra time for graceful shutdown (cleanup of child processes)
|
|
kill_timeout: 5000,
|
|
// Wait before restarting to allow full cleanup
|
|
wait_ready: true,
|
|
// Shutdown signal (SIGTERM for graceful shutdown)
|
|
kill_signal: 'SIGTERM'
|
|
}
|
|
]
|
|
};
|