Skip to content

Commit d9f8808

Browse files
authored
Merge pull request #51 from BlueMonday/マッハGoGoGo
Fix race condition in Cache.Get()
2 parents 1189f7f + 97e7acb commit d9f8808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (c *Cache) Get(key string) *Item {
8585
if item == nil {
8686
return nil
8787
}
88-
if item.expires > time.Now().UnixNano() {
88+
if !item.Expired() {
8989
c.promote(item)
9090
}
9191
return item

0 commit comments

Comments
 (0)