You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cache: Add .Set and .Add methods to cache clients (#591)
* cache: Add `.Set` and `.Add` methods to cache clients
This change adds a synchronous version of `.Set` to Memcached and Redis
clients as well as the various `Cache` wrapper implementations. This
allows callers to set a key and be sure it exists in the cache. This
change also adds an `.Add` method which conditionally adds an item to
the cache only if it does not already exist.
This change is a prerequisite for grafana/mimir#9386
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Changelog
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Code review fixes
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Add test for .Add() method semantics for LRU cache
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Assert on cache contents for LRU `.Add()` test
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
---------
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -230,6 +230,7 @@
230
230
*[ENHANCEMENT] Runtimeconfig: support gzip-compressed files with `.gz` extension. #571
231
231
*[ENHANCEMENT] grpcclient: Support custom gRPC compressors. #583
232
232
*[ENHANCEMENT] Adapt `metrics.SendSumOfGaugesPerTenant` to use `metrics.MetricOption`. #584
233
+
*[ENHANCEMENT] Cache: Add `.Add()` and `.Set()` methods to cache clients. #591
233
234
*[CHANGE] Backoff: added `Backoff.ErrCause()` which is like `Backoff.Err()` but returns the context cause if backoff is terminated because the context has been canceled. #538
234
235
*[BUGFIX] spanlogger: Support multiple tenant IDs. #59
235
236
*[BUGFIX] Memberlist: fixed corrupted packets when sending compound messages with more than 255 messages or messages bigger than 64KB. #85
0 commit comments