Close client on testconnection
This commit is contained in:
parent
3aaaad8792
commit
c1e09d0305
1 changed files with 4 additions and 2 deletions
|
@ -351,7 +351,7 @@ const SCHEMA: Integration = getSchema()
|
||||||
|
|
||||||
class MongoIntegration implements IntegrationBase {
|
class MongoIntegration implements IntegrationBase {
|
||||||
private config: MongoDBConfig
|
private config: MongoDBConfig
|
||||||
private client: any
|
private client: MongoClient
|
||||||
|
|
||||||
constructor(config: MongoDBConfig) {
|
constructor(config: MongoDBConfig) {
|
||||||
this.config = config
|
this.config = config
|
||||||
|
@ -372,6 +372,8 @@ class MongoIntegration implements IntegrationBase {
|
||||||
response.connected = true
|
response.connected = true
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
response.error = e.message as string
|
response.error = e.message as string
|
||||||
|
} finally {
|
||||||
|
await this.client.close()
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
@ -380,7 +382,7 @@ class MongoIntegration implements IntegrationBase {
|
||||||
return this.client.connect()
|
return this.client.connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
createObjectIds(json: any): object {
|
createObjectIds(json: any) {
|
||||||
const self = this
|
const self = this
|
||||||
function interpolateObjectIds(json: any) {
|
function interpolateObjectIds(json: any) {
|
||||||
for (let field of Object.keys(json)) {
|
for (let field of Object.keys(json)) {
|
||||||
|
|
Loading…
Reference in a new issue