Skip to content
Snippets Groups Projects
Commit 3ff8743c authored by ensiouel's avatar ensiouel
Browse files

refactor(WithMetrics): добавлена проверка на nil для оборачиваемого кэша

parent 3fc8da4c
Branches
Tags
No related merge requests found
...@@ -26,6 +26,9 @@ type metricsCache struct { ...@@ -26,6 +26,9 @@ type metricsCache struct {
// //
// Метрики записываются в prometheus.DefaultRegisterer // Метрики записываются в prometheus.DefaultRegisterer
func WithMetrics(cache Cache, cacheID string) Cache { func WithMetrics(cache Cache, cacheID string) Cache {
if cache == nil {
panic("cannot wrap metrics in cache, cache is nil")
}
return &metricsCache{ return &metricsCache{
cacheID: cacheID, cacheID: cacheID,
cache: cache, cache: cache,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment