@orion-js/mongodb 4.2.4 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -74,9 +74,6 @@ var OrionMongoDatabaseWrapper = class {
|
|
|
74
74
|
configTimeout;
|
|
75
75
|
constructor(connectionName) {
|
|
76
76
|
this.connectionName = connectionName;
|
|
77
|
-
logger.info("New connection requested", {
|
|
78
|
-
connectionName
|
|
79
|
-
});
|
|
80
77
|
this.connectionEvent.setMaxListeners(Number.POSITIVE_INFINITY);
|
|
81
78
|
this.connectionPromise = new Promise((resolve, reject) => {
|
|
82
79
|
if (this.state === "connected") {
|
|
@@ -122,11 +119,8 @@ var OrionMongoDatabaseWrapper = class {
|
|
|
122
119
|
return this;
|
|
123
120
|
}
|
|
124
121
|
this.state = "connecting";
|
|
125
|
-
const censoredURI = this.uri.replace(/\/\/.*:.*@/, "//");
|
|
126
|
-
logger.info(
|
|
127
|
-
uri: censoredURI,
|
|
128
|
-
connectionName: this.connectionName
|
|
129
|
-
});
|
|
122
|
+
const censoredURI = this.uri.replace(/\/\/.*:.*@/, "//").replace(/^mongodb(\+srv)?:\/\//, "");
|
|
123
|
+
logger.info(`Starting MongoDB connection "${this.connectionName}" [${censoredURI}]`);
|
|
130
124
|
if (this.encrypted.client) {
|
|
131
125
|
await this.connectWithRetry(this.encrypted.client);
|
|
132
126
|
logger.info("Successfully connected to encrypted mongo", {
|
|
@@ -137,10 +131,6 @@ var OrionMongoDatabaseWrapper = class {
|
|
|
137
131
|
await this.connectWithRetry(this.client);
|
|
138
132
|
this.state = "connected";
|
|
139
133
|
this.connectionEvent.emit("connected", this.client);
|
|
140
|
-
logger.info("Successfully connected to mongo", {
|
|
141
|
-
uri: censoredURI,
|
|
142
|
-
connectionName: this.connectionName
|
|
143
|
-
});
|
|
144
134
|
nextTick(() => {
|
|
145
135
|
this.connectionEvent.removeAllListeners();
|
|
146
136
|
this.connectionEvent = null;
|