Skip to content

Commit

Permalink
fix: redis check compat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jan 23, 2021
1 parent fdfbc90 commit 78896fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/database/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ redisModule.createSessionStore = async function (options) {

redisModule.checkCompatibility = async function () {
const info = await redisModule.info(redisModule.client);
redisModule.checkCompatibilityVersion(info.redis_version);
await redisModule.checkCompatibilityVersion(info.redis_version);
};

redisModule.checkCompatibilityVersion = function (version) {
redisModule.checkCompatibilityVersion = function (version, callback) {
if (semver.lt(version, '2.8.9')) {
throw new Error('Your Redis version is not new enough to support NodeBB, please upgrade Redis to v2.8.9 or higher.');
callback(new Error('Your Redis version is not new enough to support NodeBB, please upgrade Redis to v2.8.9 or higher.'));
}
callback();
};

redisModule.close = async function () {
Expand Down

0 comments on commit 78896fc

Please sign in to comment.