You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this as a library in order to use via a CI process, all of the commands that interact with the database would hang indefinitely.
After reviewing the main CLI code in https://github.com/seppevs/migrate-mongo/blob/master/bin/migrate-mongo.js I noticed that process.exit was being used in all these cases. For my needs, a clean exit can happen by making sure to do a close on the client object, which then allows the process to exit normally without forcing it.
My recommendation after observing this, which I can try my hand at a recommend PR if you'd like, would be to follow the same pattern in the CLI as I found where calling client.close will eliminate the need to force an exit.
The text was updated successfully, but these errors were encountered:
When using this as a library in order to use via a CI process, all of the commands that interact with the database would hang indefinitely.
After reviewing the main CLI code in https://github.com/seppevs/migrate-mongo/blob/master/bin/migrate-mongo.js I noticed that process.exit was being used in all these cases. For my needs, a clean exit can happen by making sure to do a close on the client object, which then allows the process to exit normally without forcing it.
Specifically, you can see
here
https://github.com/seppevs/migrate-mongo/blob/master/bin/migrate-mongo.js#L75
and
https://github.com/seppevs/migrate-mongo/blob/master/bin/migrate-mongo.js#L96
both interact with a connection and have process.exit
where as the create command which requires no connection does not need this pattern to stop
https://github.com/seppevs/migrate-mongo/blob/master/bin/migrate-mongo.js#L48
My recommendation after observing this, which I can try my hand at a recommend PR if you'd like, would be to follow the same pattern in the CLI as I found where calling client.close will eliminate the need to force an exit.
The text was updated successfully, but these errors were encountered: