[Plugin] fix: add missing close statement.

parent fb493f86
......@@ -63,12 +63,14 @@ object MongoDBSource {
override def process(context: Context, executionContext: MoleExecutionContext)(implicit rng: RandomProvider) = {
val mongoClient = MongoClient(host.from(context), port)
val db = mongoClient(database.from(context))
val c = db(collection.from(context))
try {
val db = mongoClient(database.from(context))
val c = db(collection.from(context))
Variable(
prototype,
query(context, c)
)
Variable(
prototype,
query(context, c)
)
} finally mongoClient.close()
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment