From 30f7ddb833adfe276a93c1a79e243b8d33bdd41e Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 9 Feb 2021 22:29:03 +0000 Subject: Ensure memcache TTL cannot be over 30 days (#14592) Memcached TTL cannot be > 30 days and if it is attempted the TTL is interpreted as a unix timestamp. This PR ensures that the TTL is switched to a unix timestamp in those cases. Fix #14571 Signed-off-by: Andrew Thornton --- modules/repository/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/repository') diff --git a/modules/repository/cache.go b/modules/repository/cache.go index 0852771a55..5d6dea8fcb 100644 --- a/modules/repository/cache.go +++ b/modules/repository/cache.go @@ -41,7 +41,7 @@ func CacheRef(repo *models.Repository, gitRepo *git.Repository, fullRefName stri return nil } - commitCache := git.NewLastCommitCache(repo.FullName(), gitRepo, int64(setting.CacheService.LastCommit.TTL.Seconds()), cache.GetCache()) + commitCache := git.NewLastCommitCache(repo.FullName(), gitRepo, setting.LastCommitCacheTTLSeconds, cache.GetCache()) return commitCache.CacheCommit(commit) } -- cgit v1.2.3