From aaa2b4baf3d347c12834c947744ce5e083cc5aad Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 19 Sep 2022 22:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/cache.go b/cache/cache.go index 97da17f..7e3b365 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -31,7 +31,7 @@ func (c *SliceCache[T]) FlushCache() { func (c *SliceCache[T]) GetCache() []T { l := len(c.data) expired := time.Duration(c.setTime.Unix())+c.expireTime/time.Second < time.Duration(time.Now().Unix()) - if l < 1 || (l > 0 && c.expireTime > 0 && expired) { + if l < 1 || (l > 0 && c.expireTime >= 0 && expired) { r, err := c.setCacheFunc() if err != nil { log.Printf("set cache err[%s]", err)