systemic-redis
Advanced tools
Comparing version 2.0.1 to 2.1.0
27
index.js
@@ -7,23 +7,4 @@ module.exports = (options) => { | ||
const connectToRedis = () => | ||
new Promise((resolve) => { | ||
client.on('ready', () => { | ||
logger.info(`Connection to redis reached ready state.`); | ||
resolve(); | ||
}); | ||
}); | ||
const connectToRedis = () => client.connect(); | ||
const closeRedisConnection = () => | ||
new Promise((resolve, reject) => { | ||
if (!client) { | ||
reject(new Error('Client has not been initialized.')); | ||
return; | ||
} | ||
logger.info(`Disconnecting from ${config.url || config.host || '127.0.0.1'}`); | ||
client.quit(() => { | ||
resolve(); | ||
}); | ||
}); | ||
const start = async (dependencies) => { | ||
@@ -62,3 +43,3 @@ config = { ...dependencies.config }; | ||
*/ | ||
keepAlive && setInterval(() => { | ||
keepAlive && setInterval(() => { | ||
client.ping(); | ||
@@ -70,5 +51,3 @@ }, keepAliveTimer); | ||
const stop = async () => { | ||
await closeRedisConnection(); | ||
}; | ||
const stop = async () => client.disconnect(); | ||
@@ -75,0 +54,0 @@ return { |
{ | ||
"name": "systemic-redis", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "A systemic redis component", | ||
@@ -12,2 +12,4 @@ "main": "index.js", | ||
"scripts": { | ||
"lint": "eslint . --ext .js", | ||
"lint:fix": "npm run lint -- --fix", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -22,5 +24,10 @@ }, | ||
"dependencies": { | ||
"redis": "^3.1.2" | ||
"redis": "^4.3.1" | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^13.2.1", | ||
"@commitlint/config-conventional": "^13.2.0", | ||
"eslint": "^8.1.0", | ||
"husky": "^7.0.4" | ||
}, | ||
"repository": { | ||
@@ -27,0 +34,0 @@ "type": "git", |
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
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
3937
11
0
4
57
+ Added@redis/bloom@1.2.0(transitive)
+ Added@redis/client@1.6.0(transitive)
+ Added@redis/graph@1.1.1(transitive)
+ Added@redis/json@1.0.7(transitive)
+ Added@redis/search@1.2.0(transitive)
+ Added@redis/time-series@1.1.0(transitive)
+ Addedcluster-key-slot@1.1.2(transitive)
+ Addedgeneric-pool@3.9.0(transitive)
+ Addedredis@4.7.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removeddenque@1.5.1(transitive)
- Removedredis@3.1.2(transitive)
- Removedredis-commands@1.7.0(transitive)
- Removedredis-errors@1.2.0(transitive)
- Removedredis-parser@3.0.0(transitive)
Updatedredis@^4.3.1