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

Kill child on process.exit() #15

Merged
merged 2 commits into from
Dec 18, 2017
Merged

Kill child on process.exit() #15

merged 2 commits into from
Dec 18, 2017

Conversation

Enselic
Copy link
Contributor

@Enselic Enselic commented Dec 15, 2017

Otherwise the java process stays around after running a node program
like this:

  const DynamoDbLocal = require('dynamodb-local');
  DynamoDbLocal.launch(8001, null, ['-sharedDb', '-inMemory'])
    .then(function() {
      process.exit(0);
    })

which happens in the wild. For example, some test frameworks behaves
like this when in so called watch mode and you type 'q' as in 'quit'.

Otherwise the java process stays around after running a node program
like this:

  const DynamoDbLocal = require('dynamodb-local');
  DynamoDbLocal.launch(8001, null, ['-sharedDb', '-inMemory'])
    .then(function() {
      process.exit(0);
    })

which happens in the wild. For example, some test frameworks behaves
like this when in so called watch mode and you type 'q' as in 'quit'.
@@ -82,6 +82,10 @@ var runningProcesses = {},
}
});

process.on('exit', function() {
child.kill();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should update runningProcesses too

@doapp-ryanp doapp-ryanp merged commit 78a06c6 into rynop:master Dec 18, 2017
@doapp-ryanp
Copy link
Collaborator

Thanks @Enselic

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.

2 participants