1
0
Fork 0
forked from forgejo/forgejo

Upgrade chi to v5 (#17298)

This commit is contained in:
Lunny Xiao 2021-10-14 10:50:23 +08:00 committed by GitHub
parent bd14c40461
commit d47798ccc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 2692 additions and 132 deletions

View file

@ -25,8 +25,6 @@ import (
"path/filepath"
"sync"
"time"
"github.com/unknwon/com"
)
// Item represents a cache item.
@ -136,7 +134,10 @@ func (c *FileCacher) Decr(key string) error {
// IsExist returns true if cached value exists.
func (c *FileCacher) IsExist(key string) bool {
return com.IsExist(c.filepath(key))
if item, err := c.read(key); err == nil {
return !item.hasExpired()
}
return false
}
// Flush deletes all cached data.