Skip to content

Commit 399e2ae

Browse files
authored
[updatenotification] Fix pm2 using detection when pm2 script is inside or outside MagicMirror root folder (#3605)
This will fix #3576 @FrankBlackMG: I don't use `*env.unique_id` because some others modules can use pm2 too for starting a service and unique_id is the same (this will make confusion) So I check `name` and `pm_id` for found it
1 parent c96326b commit 399e2ae

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _This release is scheduled to be released on 2025-01-01._
2828

2929
### Fixed
3030

31-
- [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)
31+
- [updatenotification] Fix pm2 using detection when pm2 script is inside or outside MagicMirror root folder (#3576) (#3605)
3232
- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#3578)
3333
- [weather] changed default value for weatherEndpoint of provider openweathermap to "/onecall" (#3574)
3434
- [tests] fix electron tests with mock dates, the mock on server side was missing (#3597)

modules/default/updatenotification/update_helper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ class Updater {
187187
return;
188188
}
189189
list.forEach((pm) => {
190-
if (pm.pm2_env.version === this.version && pm.pm2_env.status === "online" && pm.pm2_env.pm_cwd.includes(`${this.root_path}`)) {
190+
Log.debug(`[PM2] pm2 name: ${pm.name} -- in process env: ${process.env.name}`)
191+
Log.debug(`[PM2] pm2 pm_id: ${pm.pm_id} -- in process env: ${process.env.pm_id}`)
192+
if (pm.pm2_env.status === "online" && process.env.name === pm.name && +process.env.pm_id === +pm.pm_id) {
191193
this.PM2 = pm.name;
192194
this.usePM2 = true;
193195
Log.info("updatenotification: [PM2] You are using pm2 with", this.PM2);

0 commit comments

Comments
 (0)