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

[Mongoose V7] : Connection.prototype.close() no longer accepts a callback #352

Open
thib3113 opened this issue Mar 21, 2023 · 2 comments
Open

Comments

@thib3113
Copy link
Sponsor Contributor

thib3113 commented Mar 21, 2023

From mongoose V7, async functions will throw an error if we pass a callback (and so will skip his job) .

I saw this async functions was added years ago (4.3.8-pre) : Automattic/mongoose@21f0104
so, I think we can migrate to full promise (removing callback) without problems .

Also, we already use promises, but, passing the "resolve" function to the callback .


Actually, stopping a moleculer service, will not close the connection ( close will throw before really closing the connection )

@thib3113 thib3113 changed the title [Mongoose] : Connection.prototype.close() no longer accepts a callback [Mongoose V7] : Connection.prototype.close() no longer accepts a callback Mar 21, 2023
@thib3113
Copy link
Sponsor Contributor Author

@icebob what versions of mongoose do you want to support on this lib ? I didn't find the information .

If not decided, I propose to follow the same as mongoose itself ? https://mongoosejs.com/docs/version-support.html so, supporting V6 and V7 . ( maybe V5 and we stop the support in some months ? )

@icebob
Copy link
Member

icebob commented Sep 7, 2023

The current version supports v6, we can support v7, but in this case we should release it in a new major version.

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