exframe-cache-manager 2.0.0 → 2.0.3

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.
Files changed (2) hide show
  1. package/index.js +12 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -30,6 +30,17 @@ function cachemanager(options) {
30
30
  const redisClient = redisStore.getClient();
31
31
  redisClient.setMaxListeners(0);
32
32
 
33
+ redisClient.on('error', (e) => {
34
+ console.log('Unhandled Redis Error', { errorDetails: e }); // eslint-disable-line
35
+ });
36
+
37
+ process.on('beforeExit', () => {
38
+ if (redisClient.connected) {
39
+ redisClient.removeAllListeners();
40
+ redisClient.end(true);
41
+ }
42
+ });
43
+
33
44
  const instance = {
34
45
  get cacheStorePool() {
35
46
  return redisClient;
@@ -101,6 +112,7 @@ function cachemanager(options) {
101
112
 
102
113
  close() {
103
114
  return new Promise(res => {
115
+ redisClient.removeAllListeners();
104
116
  redisClient.end(true);
105
117
  res();
106
118
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exframe-cache-manager",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "Managing the cache",
5
5
  "main": "index.js",
6
6
  "config": {
@@ -45,5 +45,5 @@
45
45
  "url": "https://bitbucket.org/exzeo-usa/exframe",
46
46
  "directory": "packages/exframe-cache-manager"
47
47
  },
48
- "gitHead": "93013f9bb8a75217a24b69b7c2ad72b8baebddc7"
48
+ "gitHead": "846806709f00dedc764c794b3ee05ca3c7297244"
49
49
  }