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

Delay workers from closing (Closes #167) #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smtlaissezfaire
Copy link

We need to do some db cleanup before exiting workers (same issues seen #167).

The old implementation calls process.nextTick(process.exit()) - which prevents any new code on the event queue from running after the event is emitted, but before process.exit() is called.

Also, it appears as though the 'close' event was never propagated up to the master. I decided to propagate 'worker closed' instead.

Commit Message:

  • emit 'worker close' in master process when a worker closes
  • delay execution of process.exit with a callback when listening on 'worker close'

This closes #167

* delay execution of process.exit with a callback when listening on 'worker close'

Closes LearnBoost#167
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