fix cd issue of not-logged-in-users

This commit is contained in:
HF 2022-07-31 10:31:39 +02:00
parent cc8ccf95e6
commit b355aa60d4

View File

@ -177,7 +177,7 @@ class User {
await redis.set(`cd:${canvasId}:ip:${this.ipSub}`, '', { await redis.set(`cd:${canvasId}:ip:${this.ipSub}`, '', {
PX: wait, PX: wait,
}); });
if (this.id != null) { if (this.id) {
await redis.set(`cd:${canvasId}:id:${this.id}`, '', { await redis.set(`cd:${canvasId}:id:${this.id}`, '', {
PX: wait, PX: wait,
}); });
@ -187,7 +187,7 @@ class User {
async getWait(canvasId: number): Promise<?number> { async getWait(canvasId: number): Promise<?number> {
let ttl = await redis.pTTL(`cd:${canvasId}:ip:${this.ipSub}`); let ttl = await redis.pTTL(`cd:${canvasId}:ip:${this.ipSub}`);
if (this.id != null) { if (this.id) {
const ttlid = await redis.pTTL( const ttlid = await redis.pTTL(
`cd:${canvasId}:id:${this.id}`, `cd:${canvasId}:id:${this.id}`,
); );