From 6056b8bb61c2e36747cba61427d7efdb7a3a7d94 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 13 May 2021 14:34:04 +0100 Subject: [PATCH] Fixing issues with redis keys, however still not removing lock. --- packages/auth/src/redis/index.js | 4 ++-- packages/server/src/api/controllers/dev.js | 2 +- packages/server/src/utilities/redis.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/auth/src/redis/index.js b/packages/auth/src/redis/index.js index dc670c07fb..544f2b729b 100644 --- a/packages/auth/src/redis/index.js +++ b/packages/auth/src/redis/index.js @@ -144,8 +144,8 @@ class RedisWrapper { async clear() { const db = this._db - let items = await this.scan(db) - await Promise.all(items.map(obj => this.delete(db, obj.key))) + let items = await this.scan() + await Promise.all(items.map(obj => this.delete(obj.key))) } } diff --git a/packages/server/src/api/controllers/dev.js b/packages/server/src/api/controllers/dev.js index 3eeacf4a6c..ae9ffa2a8c 100644 --- a/packages/server/src/api/controllers/dev.js +++ b/packages/server/src/api/controllers/dev.js @@ -43,6 +43,6 @@ exports.removeLock = async ctx => { ctx.throw(400, `Unable to remove lock. ${err}`) } ctx.body = { - message: "Lock removed successfully.", + message: "Lock released successfully.", } } diff --git a/packages/server/src/utilities/redis.js b/packages/server/src/utilities/redis.js index ad1700c346..0234d6d218 100644 --- a/packages/server/src/utilities/redis.js +++ b/packages/server/src/utilities/redis.js @@ -50,5 +50,5 @@ exports.clearLock = async (devAppId, user) => { if (value._id !== userId) { throw "User does not hold lock, cannot clear it." } - await devAppClient.delete(devAppClient) + await devAppClient.delete(devAppId) }