feat: cache topic and subscription reads
This commit is contained in:
@@ -1497,7 +1497,9 @@ func (r *redisGroupMessageRuntime) loginSessionKey(tokenHash string) string {
|
||||
|
||||
func (r *redisGroupMessageRuntime) cacheTTL(namespace string) time.Duration {
|
||||
ttl := r.cfg.CacheTTL
|
||||
if namespace == "verification" || namespace == "action_token" || namespace == "login_lockout" {
|
||||
if namespace == cacheNamespaceTopic || namespace == cacheNamespaceSub {
|
||||
ttl = 60
|
||||
} else if namespace == "verification" || namespace == "action_token" || namespace == "login_lockout" {
|
||||
ttl = r.cfg.ShortTTL
|
||||
}
|
||||
return time.Duration(ttl) * time.Second
|
||||
|
||||
Reference in New Issue
Block a user