aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-02-09 22:29:03 +0000
committerGitHub <noreply@github.com>2021-02-09 22:29:03 +0000
commit30f7ddb833adfe276a93c1a79e243b8d33bdd41e (patch)
tree923227416de1d00b9158a43e64dcb0ceac2d5023 /routers/repo
parent3a4801d1958ce33c9b893433c096281aa5b9b1c5 (diff)
downloadgitea-30f7ddb833adfe276a93c1a79e243b8d33bdd41e.tar.gz
gitea-30f7ddb833adfe276a93c1a79e243b8d33bdd41e.zip
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 <art27@cantab.net>
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/view.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index e50e4613b7..a5e3cbe3e4 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -140,7 +140,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
var c *git.LastCommitCache
if setting.CacheService.LastCommit.Enabled && ctx.Repo.CommitsCount >= setting.CacheService.LastCommit.CommitsCount {
- c = git.NewLastCommitCache(ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, int64(setting.CacheService.LastCommit.TTL.Seconds()), cache.GetCache())
+ c = git.NewLastCommitCache(ctx.Repo.Repository.FullName(), ctx.Repo.GitRepo, setting.LastCommitCacheTTLSeconds, cache.GetCache())
}
var latestCommit *git.Commit