mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-06-26 18:33:44 -07:00
03e4eef3d1
Previously, `nodeRestart()` would spawn a detached child and exit. Under PM2 that's a problem: PM2 also respawns on exit, so both race to bind the same port. The fix: When `process.env.pm_id` is set, just exit and let PM2 handle the restart. The spawn logic is moved into its own method so it can be tested cleanly. Partially fixes #4165