세션 무효화시 접속 종료 처리

This commit is contained in:
2023-12-28 10:57:42 +09:00
parent d1e892d449
commit 45883436c5
3 changed files with 89 additions and 2 deletions

View File

@ -257,6 +257,15 @@ func (c *consumer_redis) Touch(pk string) (Authorization, error) {
defer c.lock.Unlock()
sk := publickey_to_storagekey(publickey(pk))
if _, deleted := c.stages[0].deleted[sk]; deleted {
return Authorization{}, nil
}
if _, deleted := c.stages[1].deleted[sk]; deleted {
return Authorization{}, nil
}
ok, err := c.redisClient.Expire(c.ctx, string(sk), c.ttl).Result()
if err == redis.Nil {
logger.Println("session consumer touch :", pk, err)