Add API to allow the MaxCost of an existing cache to be updated.#200
Add API to allow the MaxCost of an existing cache to be updated.#200
Conversation
cache_test.go
Outdated
| // Update the max cost of the cache and retry. | ||
| c.UpdateMaxCost(1000) | ||
| require.Equal(t, int64(1000), c.MaxCost()) | ||
| if c.Set(1, 1, 1) { |
There was a problem hiding this comment.
what if this set fail? Shouldn't we do a require.True (t, c.Set(...))
cache_test.go
Outdated
| }) | ||
| require.NoError(t, err) | ||
| require.Equal(t, int64(10), c.MaxCost()) | ||
| if c.Set(1, 1, 1) { |
There was a problem hiding this comment.
what if this set fail? Shouldn't we do a require.True (t, c.Set(...))
manishrjain
left a comment
There was a problem hiding this comment.
Looks alright to me. Will wait for @jarifibrahim 's review.
Reviewed 3 of 3 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @martinmr)
martinmr
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jarifibrahim)
cache_test.go, line 101 at r1 (raw file):
Previously, jarifibrahim (Ibrahim Jarif) wrote…
what if this set fail? Shouldn't we do a require.True (t, c.Set(...))
Done.
cache_test.go, line 112 at r1 (raw file):
Previously, jarifibrahim (Ibrahim Jarif) wrote…
what if this set fail? Shouldn't we do a
require.True (t, c.Set(...))
Done.
This change is