systemic-redis
Advanced tools
Comparing version 2.0.0 to 2.0.1
15
index.js
@@ -35,2 +35,9 @@ module.exports = (options) => { | ||
const { keepAlive, keepAliveTimer: keepAliveTimerParam } = config; | ||
if (keepAliveTimerParam && (isNaN(keepAliveTimerParam) || keepAliveTimerParam <= 0)) { | ||
throw new Error(`${keepAliveTimerParam} is not a valid number.`); | ||
} | ||
// 30 seconds by default | ||
const keepAliveTimer = keepAliveTimerParam ? keepAliveTimerParam * 1000 : 30000; | ||
({ logger } = dependencies); | ||
@@ -51,2 +58,10 @@ | ||
/** | ||
* Redis instances in Azure disconnect the client after an IDLE time causing a forced reconnection. | ||
* https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#file-redis-bestpractices-node-js-md | ||
*/ | ||
keepAlive && setInterval(() => { | ||
client.ping(); | ||
}, keepAliveTimer); | ||
return client; | ||
@@ -53,0 +68,0 @@ }; |
{ | ||
"name": "systemic-redis", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A systemic redis component", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"redis": "^3.0.2" | ||
"redis": "^3.1.2" | ||
}, | ||
@@ -33,2 +33,2 @@ "devDependencies": {}, | ||
"homepage": "https://github.com/guidesmiths/systemic-redis#readme" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3822
5
63
Updatedredis@^3.1.2