Fixing issues with redis keys, however still not removing lock.
This commit is contained in:
parent
c87319c267
commit
86000b1714
|
@ -144,8 +144,8 @@ class RedisWrapper {
|
||||||
|
|
||||||
async clear() {
|
async clear() {
|
||||||
const db = this._db
|
const db = this._db
|
||||||
let items = await this.scan(db)
|
let items = await this.scan()
|
||||||
await Promise.all(items.map(obj => this.delete(db, obj.key)))
|
await Promise.all(items.map(obj => this.delete(obj.key)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,6 @@ exports.removeLock = async ctx => {
|
||||||
ctx.throw(400, `Unable to remove lock. ${err}`)
|
ctx.throw(400, `Unable to remove lock. ${err}`)
|
||||||
}
|
}
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
message: "Lock removed successfully.",
|
message: "Lock released successfully.",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,5 +50,5 @@ exports.clearLock = async (devAppId, user) => {
|
||||||
if (value._id !== userId) {
|
if (value._id !== userId) {
|
||||||
throw "User does not hold lock, cannot clear it."
|
throw "User does not hold lock, cannot clear it."
|
||||||
}
|
}
|
||||||
await devAppClient.delete(devAppClient)
|
await devAppClient.delete(devAppId)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue