Skip to content

fix: restore cache service on PM2 restart - #1101

Merged
pastelsky merged 2 commits into
bundlephobiafrom
codex/fix-cache-service-process
Aug 20, 2026
Merged

fix: restore cache service on PM2 restart#1101
pastelsky merged 2 commits into
bundlephobiafrom
codex/fix-cache-service-process

Conversation

@pastelsky

Copy link
Copy Markdown
Owner

Root cause

Production cache writes were failing because PM2 was configured with ./cache-service/index.js, but the repository only contains cache-service/index.ts. PM2 omitted the cache service during restarts, leaving port 7001 closed while the main app continued running.

Changes

  • point PM2 at the tracked TypeScript cache-service entrypoint
  • enable Node type stripping for that process
  • add a process-contract integration test that parses every PM2 entrypoint, checks scripts exist, validates TypeScript runtime flags and syntax, and starts the configured cache-service command to verify it listens on port 7001
  • run the new test through the existing CI test command without changing workflow files

Verification

  • node --test scripts/validate-process-config.test.mjs
  • yarn format:check on changed files
  • yarn typecheck
  • yarn build
  • pre-commit hook passed with existing repository lint warnings

The PR is not deployed.

Comment thread package.json Outdated
"start": "DEBUG='bp:*' NODE_ENV=production node ./index.js",
"prod": "yarn run build && yarn start",
"test": "jest",
"test:process-config": "node --test scripts/validate-process-config.test.mjs",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test using normal jest tests.

@pastelsky
pastelsky marked this pull request as ready for review August 20, 2026 17:50
@pastelsky
pastelsky enabled auto-merge August 20, 2026 17:50
@pastelsky
pastelsky disabled auto-merge August 20, 2026 17:50
@pastelsky
pastelsky merged commit fb9c658 into bundlephobia Aug 20, 2026
5 checks passed
@pastelsky
pastelsky deleted the codex/fix-cache-service-process branch August 20, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant