Skip to content

Feature/restart activity worker #12

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

Conversation

MichaelKovalchuk
Copy link
Contributor

Sometimes, in case of unhandled error, I want to restart the worker instead of calling process.exit and relying on recluster to restart the app.
worker.close will effectively remove the listeners and reduce the number of pools to 0. That is why i couldn't just call close -> start.

Sometimes, in case of unhandled error - I want to restart the worker instead of calling `process.exit` and relying on recluster to restart the app.
If you call worker.close - will effectively remove the listeners and reduce the number of pools to 0. That is why i couldn't just call `close -> start`.
@piercus
Copy link
Owner

piercus commented Jan 28, 2019

Hello @MichaelKovalchuk,

Thanks for the PR, this is a good feature.

Few remarks :

  • It would be better if "restart" is using only "stop" and "start" functions and then the code is more DRY
  • A unit test is needed for this "restart" method

I will suggest another version in few days and it would be great if can review it and confirm it fits your needs

@MichaelKovalchuk
Copy link
Contributor Author

Totally agree. Closing this PR in favour of #13.

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