owservable 0.8.12 → 0.8.15

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.
@@ -15,19 +15,29 @@ class MongoDBConnector {
15
15
  static init(mongoDbUri) {
16
16
  return __awaiter(this, void 0, void 0, function* () {
17
17
  if (!this._connection) {
18
- mongoose
19
- .connect(mongoDbUri, {
20
- poolSize: 10,
21
- useNewUrlParser: true,
22
- useUnifiedTopology: true
23
- })
24
- .then(() => {
25
- this._connection = mongoose.connection;
26
- this._connection.on('error', console.error.bind(console, 'connection error:'));
27
- this._connection.once('open', () => console.log('ows -> MongoDB connected to', mongoDbUri));
28
- return this._connection;
29
- })
30
- .catch(console.error);
18
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
19
+ console.log('');
20
+ mongoose
21
+ .connect(mongoDbUri, {
22
+ poolSize: 10,
23
+ useNewUrlParser: true,
24
+ useUnifiedTopology: true,
25
+ keepAlive: true,
26
+ keepAliveInitialDelay: 100000
27
+ })
28
+ .then(() => {
29
+ this._connection = mongoose.connection;
30
+ resolve(this._connection);
31
+ })
32
+ .catch(reject);
33
+ mongoose.connection.on('connecting', () => console.log('ows -> MongoDB connecting to', mongoDbUri, '...'));
34
+ mongoose.connection.on('connected', () => console.log('ows -> MongoDB connected to', mongoDbUri));
35
+ mongoose.connection.on('open', () => console.log('ows -> MongoDB opened connection to', mongoDbUri));
36
+ mongoose.connection.on('error', console.error.bind(console, 'ows -> MongoDB connection error:'));
37
+ mongoose.connection.on('disconnecting', () => console.error('ows -> MongoDB disconnecting from', mongoDbUri, '...'));
38
+ mongoose.connection.on('disconnected', () => console.error('ows -> MongoDB disconnected from', mongoDbUri));
39
+ mongoose.connection.on('close', () => console.error('ows -> MongoDB closed connection to', mongoDbUri));
40
+ }));
31
41
  }
32
42
  else {
33
43
  return this._connection;
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb.connector.js","sourceRoot":"","sources":["../../src/mongodb/mongodb.conn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