Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: 正常終了でない場合は再起動しない #185

Open
pizzacat83 opened this issue Aug 29, 2019 · 2 comments
Open

deploy: 正常終了でない場合は再起動しない #185

pizzacat83 opened this issue Aug 29, 2019 · 2 comments

Comments

@pizzacat83
Copy link
Member

デプロイ時にコマンドの終了コードを見てあげて、正常終了でない場合は再起動しないようにする

@cookie-s
Copy link
Member

https://github.com/tsg-ut/slackbot/blob/master/deploy/index.ts
確かになにも構わず死んでそう

@cookie-s
Copy link
Member

https://nodejs.org/api/child_process.html#child_processspawncommand-args-options

slackbot/deploy/index.ts

Lines 90 to 95 in 2a72c4c

Promise.all([
new Promise<void>((resolve) => proc.stdout.on('end', () => resolve())),
new Promise<void>((resolve) => proc.stderr.on('end', () => resolve())),
]).then(() => {
muxed.end();
});

たぶんこのへんにproc.on('close', (code) =>ってするといい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants