apostrophe-caches-redis
Advanced tools
Comparing version 2.1.5 to 2.1.6
# Changelog | ||
## 2.1.6 - 2023-02-17 | ||
- Fixed the `removeBadIndexMigration` migration to not cause an error due to the lack of collections when using redis. Thanks to [Felix](https://github.com/felixlberg). | ||
- Changes method of closing the redis connection to use `quit()` in place of the soon to be deprecated `removeAllListeners()` and `destroy()` methods. Thanks to [Felix](https://github.com/felixlberg). | ||
## 2.1.5 - 2023-02-01 | ||
@@ -4,0 +9,0 @@ |
20
index.js
@@ -13,5 +13,7 @@ // TODO: | ||
construct: function(self, options) { | ||
//The removeAllListeners and destroy methods were used in earlier versions of the redis to close a connection. | ||
//However, in recent versions of the redis, the recommended method for closing a connection | ||
//is to call the quit method on the Redis client instance. | ||
self.on('apostrophe:destroy', 'closeRedisConnection', function() { | ||
self.client.stream.removeAllListeners(); | ||
self.client.stream.destroy(); | ||
self.client.quit(); | ||
}); | ||
@@ -38,2 +40,16 @@ // Replace the apostrophe-caches implementation of getCollection in a bc way | ||
// Override removeBadIndexMigration function, which is not needed since we are | ||
// not using mongo collections | ||
self.removeBadIndexMigration = function() { | ||
self.on('apostrophe:modulesReady', 'addRemoveBadIndexMigration', function() { | ||
try { | ||
self.apos.migrations.add(self.__meta.name + '.removeBadIndex', async function() { | ||
// remove the code that references the "indexes" property | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}); | ||
}; | ||
self.constructCache = function(name) { | ||
@@ -40,0 +56,0 @@ |
{ | ||
"name": "apostrophe-caches-redis", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "Redis-based cache for the Apostrophe CMS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
15622
355