We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c.Set("1", 10, WithExpiration(10*time.Minute)) // queue index 0 c.Set("2", 20, WithExpiration(20*time.Minute)) // queue index 1 c.Set("1", 11, WithExpiration(100*time.Minute)) // must queue index 0 move to 1, check point nowFunc = func() time.Time { return now.Add(30 * time.Minute).Add(time.Minute) } maxItems = c.Len() c.DeleteExpired() got3 := c.Len() want3 := maxItems - 1 if want3 != got3 { t.Errorf("want3 %d items but got3 %d", want3, got3) }
func (m *expirationManager[K]) update(key K, expiration time.Time) { if e, ok := m.mapping[key]; ok { e.expiration = expiration heap.Fix(&m.queue, e.index) } else {
The text was updated successfully, but these errors were encountered:
fixed issue #51
c0de4d3
Merge pull request #52 from Code-Hex/fix/51
4505cb1
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: