@mimik/mongooser 1.7.0 → 1.8.0
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/index.js +8 -6
- package/package.json +7 -4
package/index.js
CHANGED
|
@@ -92,12 +92,14 @@ module.exports = (config) => {
|
|
|
92
92
|
logger.info('creating a database connection', { type, settings: mongoSettingsClone }, correlationId);
|
|
93
93
|
}
|
|
94
94
|
else logger.info('creating a database connection', { type, settings: mongoSettings }, correlationId);
|
|
95
|
-
mongoose.connect(mongoSettings.url, options)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
mongoose.connect(mongoSettings.url, options)
|
|
96
|
+
.then(() => mongoose)
|
|
97
|
+
.catch((error) => {
|
|
98
|
+
fatal = true;
|
|
99
|
+
logger.error('Fatal error: Could not connect to database', { type, error }, correlationId);
|
|
100
|
+
if (interval) clearInterval(interval);
|
|
101
|
+
logger.flushAndExit(1);
|
|
102
|
+
});
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
mongoose.connection.on('disconnected', () => {
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/mongooser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Helper for setting up mongodb using mongoose for mimik microservices",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=12.0.0"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"lint": "gulp lint",
|
|
8
11
|
"docs": "gulp docs",
|
|
@@ -33,12 +36,12 @@
|
|
|
33
36
|
"@mimik/sumologic-winston-logger": "^1.6.6",
|
|
34
37
|
"bluebird": "3.7.2",
|
|
35
38
|
"lodash": "4.17.21",
|
|
36
|
-
"mongoose": "
|
|
39
|
+
"mongoose": "6.1.5"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@mimik/eslint-plugin-dependencies": "^2.4.1",
|
|
40
|
-
"@mimik/eslint-plugin-document-env": "^1.0.
|
|
41
|
-
"eslint": "
|
|
43
|
+
"@mimik/eslint-plugin-document-env": "^1.0.1",
|
|
44
|
+
"eslint": "7.2.0",
|
|
42
45
|
"eslint-config-airbnb": "18.2.1",
|
|
43
46
|
"eslint-plugin-import": "2.25.3",
|
|
44
47
|
"eslint-plugin-jsx-a11y": "6.5.1",
|