fix: controller 자체 갱신의 PM2 인자 복구

daemon 기본 명령을 사용해 PM2가 단일 인자 배열을 JSON 문자열로 전달하는 운영 오류를 피한다.
This commit is contained in:
2026-08-20 02:33:36 +00:00
parent 42f390a163
commit fafe4909dc
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ export const buildReleaseControllerDefinition = (
name: CONTROLLER_PROCESS_NAME,
script: path.join(workspaceRoot, 'app', 'release-controller', 'dist', 'index.js'),
cwd: path.join(workspaceRoot, 'app', 'release-controller'),
args: ['daemon'],
// The CLI defaults to daemon. Omitting a one-element args array avoids PM2
// serializing it as the literal `["daemon"]` during an in-process self-upgrade.
env: {
...sanitizeManagedProcessEnv(config.baseEnv),
GATEWAY_DATABASE_URL: config.gatewayDatabaseUrl,
@@ -445,8 +445,8 @@ describe('upgradeReleaseController', () => {
expect(starts.at(-1)).toMatchObject({
name: 'sammo:release-controller',
cwd: path.join(workspace, 'app', 'release-controller'),
args: ['daemon'],
});
expect(starts.at(-1)?.args).toBeUndefined();
});
it('restores the old controller definition when the new daemon cannot start', async () => {