Skip to content

Commit

Permalink
Fix droppedSets count (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Jarif committed Jul 1, 2020
1 parent f66de99 commit 23cfd7b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cache.go
Expand Up @@ -234,11 +234,14 @@ func (c *Cache) SetWithTTL(key, value interface{}, cost int64, ttl time.Duration
case c.setBuf <- i:
return true
default:
if i.flag == itemUpdate {
// Return true if this was an update operation since we've already
// updated the store. For all the other operations (set/delete), we
// return false which means the item was not inserted.
return true
}
c.Metrics.add(dropSets, keyHash, 1)
// Return true if this was an update operation since we've already
// updated the store. For all the other operations (set/delete), we
// return false which means the item was not inserted.
return i.flag == itemUpdate
return false
}
}

Expand Down

0 comments on commit 23cfd7b

Please sign in to comment.