chore: pin pm2 process definition in the repo - #6
Open
varffs wants to merge 2 commits into
Open
Conversation
NODE_ENV=production lived only in pm2's saved dump — a dump rebuild dropped it silently and RTK's dev-mode state checks cost ~157ms/action at a full history ring. ecosystem.config.cjs makes it declarative: pm2 startOrReload ecosystem.config.cjs && pm2 save Also enables log timestamps (time: true); the 2026-07-28 push-failure investigation had only the log file's mtime to date errors with. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a declarative PM2 process definition to the repository to prevent configuration drift during deploys (notably ensuring NODE_ENV=production is consistently set) and to enable timestamped log lines for better operational debugging.
Changes:
- Added
ecosystem.config.cjsdefining the PM2 app configuration (includingNODE_ENV=productionandtime: true). - Updated
CHANGELOG.mdto document the addition.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ecosystem.config.cjs | Introduces a repo-pinned PM2 process definition to stabilize deploy behavior and improve log observability. |
| CHANGELOG.md | Notes the new PM2 ecosystem config in the Unreleased changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review flagged the hardcoded /home/polyteknix/polyteknix — __dirname keeps the config portable to a fresh device or different user. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ecosystem.config.cjsso the pm2 process definition is declarative instead of living only in~/.pm2/dump.pm2on the device.Why it matters:
NODE_ENV=productionis load-bearing — RTK's dev-mode serializable/immutable checks cost ~157ms/action at a full history ring (measured on the Pi, 2026-07-27). Until now a pm2 dump rebuild would silently drop it and the device would degrade over the following two days. With this file the deploy step becomes:Also enables
time: true— log lines get timestamps. The 2026-07-28 push-failure investigation (EAI_AGAIN/ 520 lines in the error log) had nothing to date the errors with except the log file's mtime..cjsbecause the package is"type": "module"and pm2 loads config viarequire(). Config mirrors the process exactly as it runs today (name, script, cwd, fork mode) — verified againstpm2 describeon the device. File validated loadable with node.No app code changes.
🤖 Generated with Claude Code