Skip to content
New issue

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

Remove key from policy after TTL eviction #130

Merged
merged 3 commits into from
Jan 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Control insert in recache test
  • Loading branch information
ldechoux committed Jan 30, 2020
commit baf81542a38f664b5e1ef624b555e8f52cf2f5be
6 changes: 4 additions & 2 deletions cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ func TestRecacheWithTTL(t *testing.T) {
require.NoError(t, err)

// Set initial value for key = 1
c.SetWithTTL(1, 1, 1, 5*time.Second)
insert := c.SetWithTTL(1, 1, 1, 5*time.Second)
require.True(t, insert)
time.Sleep(2 * time.Second)

// Get value from cache for key = 1
Expand All @@ -359,7 +360,8 @@ func TestRecacheWithTTL(t *testing.T) {
require.Nil(t, val)

// Set new value for key = 1
c.SetWithTTL(1, 2, 1, 5*time.Second)
insert = c.SetWithTTL(1, 2, 1, 5*time.Second)
require.True(t, insert)
time.Sleep(2 * time.Second)

// Get value from cache for key = 1
Expand Down