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/git/last_commit_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/git/last_commit_cache.go') diff --git a/modules/git/last_commit_cache.go b/modules/git/last_commit_cache.go index 7cca601226..37a59e1fa8 100644 --- a/modules/git/last_commit_cache.go +++ b/modules/git/last_commit_cache.go @@ -25,5 +25,5 @@ func (c *LastCommitCache) getCacheKey(repoPath, ref, entryPath string) string { // Put put the last commit id with commit and entry path func (c *LastCommitCache) Put(ref, entryPath, commitID string) error { log("LastCommitCache save: [%s:%s:%s]", ref, entryPath, commitID) - return c.cache.Put(c.getCacheKey(c.repoPath, ref, entryPath), commitID, c.ttl) + return c.cache.Put(c.getCacheKey(c.repoPath, ref, entryPath), commitID, c.ttl()) } -- cgit v1.2.3