diff --git a/src/user.ts b/src/user.ts index 82a2e24..0be2647 100644 --- a/src/user.ts +++ b/src/user.ts @@ -88,8 +88,7 @@ export default class User { }; public async itemLock(): Promise { - const lock = await redis.get(`user:${this.id}:itemlock`); - return lock === '1'; + return await redis.exists(`user:${this.id}:itemlock`); }; public async setLock(): Promise { @@ -97,7 +96,7 @@ export default class User { }; public async clearLock(): Promise { - await redis.set(`user:${this.id}:itemlock`, '0'); + await redis.del(`user:${this.id}:itemlock`); }; public async setVulnerable(): Promise {