@mimik/rediser 1.4.10 → 1.4.12
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 +10 -6
- package/package.json +12 -12
package/index.js
CHANGED
|
@@ -15,7 +15,8 @@ const VALIDATION_CHECK = 100; // in ms
|
|
|
15
15
|
const CONNECTED = 1;
|
|
16
16
|
const DISCONNECTED = 2;
|
|
17
17
|
|
|
18
|
-
let
|
|
18
|
+
let displayCreate = true;
|
|
19
|
+
let displayDisconnect = true;
|
|
19
20
|
let state = DISCONNECTED;
|
|
20
21
|
|
|
21
22
|
module.exports = (set, config) => {
|
|
@@ -31,8 +32,10 @@ module.exports = (set, config) => {
|
|
|
31
32
|
*/
|
|
32
33
|
const initializeSync = () => {
|
|
33
34
|
if (set !== 'on') {
|
|
34
|
-
if (
|
|
35
|
-
|
|
35
|
+
if (displayCreate) {
|
|
36
|
+
logger.info('cache not enabled', { type }, correlationId);
|
|
37
|
+
displayCreate = false;
|
|
38
|
+
}
|
|
36
39
|
return null;
|
|
37
40
|
}
|
|
38
41
|
let interval;
|
|
@@ -41,12 +44,12 @@ module.exports = (set, config) => {
|
|
|
41
44
|
if (!interval) {
|
|
42
45
|
interval = setInterval(() => {
|
|
43
46
|
if (state !== CONNECTED) {
|
|
44
|
-
if (
|
|
47
|
+
if (displayDisconnect) {
|
|
45
48
|
logger.error('fatal error: Timeout in connecting to cache', {
|
|
46
49
|
type, error: state, timeout: redisSettings.connectTimeout,
|
|
47
50
|
}, correlationId);
|
|
51
|
+
displayDisconnect = false;
|
|
48
52
|
}
|
|
49
|
-
display = false;
|
|
50
53
|
logger.flushAndExit(1);
|
|
51
54
|
}
|
|
52
55
|
else {
|
|
@@ -57,7 +60,7 @@ module.exports = (set, config) => {
|
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
|
|
60
|
-
if (
|
|
63
|
+
if (displayCreate) {
|
|
61
64
|
if (isProd(config.nodeEnvironment)) {
|
|
62
65
|
const redisSettingsClone = { ...redisSettings };
|
|
63
66
|
|
|
@@ -65,6 +68,7 @@ module.exports = (set, config) => {
|
|
|
65
68
|
logger.info('creating a cache connection', { type, settings: redisSettingsClone }, correlationId);
|
|
66
69
|
}
|
|
67
70
|
else logger.info('creating a cache connection', { type, settings: redisSettings }, correlationId);
|
|
71
|
+
displayCreate = false;
|
|
68
72
|
}
|
|
69
73
|
const client = redis.createClient(redisSettings.url, redisSettings.options);
|
|
70
74
|
client.connect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimik/rediser",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"description": "Helper for setting up redis using redis for mimik microservices",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"url": "https://bitbucket.org/mimiktech/rediser"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mimik/lib-filters": "^1.4.
|
|
33
|
-
"@mimik/sumologic-winston-logger": "^1.6.
|
|
32
|
+
"@mimik/lib-filters": "^1.4.5",
|
|
33
|
+
"@mimik/sumologic-winston-logger": "^1.6.11",
|
|
34
34
|
"bluebird": "3.7.2",
|
|
35
|
-
"redis": "4.1
|
|
35
|
+
"redis": "4.5.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@mimik/eslint-plugin-dependencies": "^2.4.
|
|
39
|
-
"@mimik/eslint-plugin-document-env": "^1.0.
|
|
40
|
-
"eslint": "8.
|
|
38
|
+
"@mimik/eslint-plugin-dependencies": "^2.4.4",
|
|
39
|
+
"@mimik/eslint-plugin-document-env": "^1.0.4",
|
|
40
|
+
"eslint": "8.28.0",
|
|
41
41
|
"eslint-config-airbnb": "19.0.4",
|
|
42
42
|
"eslint-plugin-import": "2.26.0",
|
|
43
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
44
|
-
"eslint-plugin-react": "7.
|
|
45
|
-
"eslint-plugin-react-hooks": "4.
|
|
46
|
-
"husky": "8.0.
|
|
47
|
-
"jsdoc-to-markdown": "
|
|
43
|
+
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
44
|
+
"eslint-plugin-react": "7.31.11",
|
|
45
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
46
|
+
"husky": "8.0.2",
|
|
47
|
+
"jsdoc-to-markdown": "8.0.0"
|
|
48
48
|
}
|
|
49
49
|
}
|