add max lifetime to connections

This commit is contained in:
William Will 2025-04-16 04:55:38 +00:00 committed by Jan Larwig
parent 3ac52f3853
commit 4e939cac37
No known key found for this signature in database
GPG Key ID: C2172BFA220A037A
1 changed files with 2 additions and 0 deletions

View File

@ -199,6 +199,8 @@ func setupAWSIAMAuth(opts options.RedisStoreOptions, opt *redis.Options) error {
} }
return opts.AWSUsername, token return opts.AWSUsername, token
} }
// AWS services has a max connection lifetime of 12 hours. This is set to 11 hours to give some buffer time
opt.ConnMaxLifetime = 11 * time.Hour
return nil return nil
} }