ttl 업데이트

This commit is contained in:
2024-02-21 12:49:38 +09:00
parent 0ca764d6be
commit 08238b22d2

View File

@ -47,8 +47,11 @@ func (p *provider_redis) New(input *Authorization) (string, error) {
if err != nil {
return "", err
}
_, err = p.redisClient.Expire(p.ctx, string(sk), p.ttl).Result()
if err != nil {
return "", err
}
pk := storagekey_to_publickey(sk)
return string(pk), err
}
@ -202,6 +205,9 @@ func (c *consumer_redis) query_internal(sk storagekey) (*sessionRedis, error) {
logger.Println("consumer Query :", err)
return nil, err
}
if ttl < 0 {
ttl = time.Duration(time.Hour * 24)
}
auth := MakeAuthrizationFromStringMap(payload)
si := &sessionRedis{