Skip to content

Comments

🐛 Close MongoDB client#118

Open
ilaborie wants to merge 1 commit intomasterfrom
bugfix/117_close_mongo_connections
Open

🐛 Close MongoDB client#118
ilaborie wants to merge 1 commit intomasterfrom
bugfix/117_close_mongo_connections

Conversation

@ilaborie
Copy link
Contributor

Fix #117


private val collection by lazy {
with(KMongo.createClient(ConnectionString(getConnectionString()))) {
with(client) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If client return a Closeable instance, we can avoid to close it after and replace the when with a use

Any idea to have that ?

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.

Close mongo connections in action and persist engine

2 participants