From d9349f58afde400943511a965e25cd08b1182a35 Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Tue, 16 Jul 2024 16:04:34 +0200 Subject: [PATCH] Disable cache for layer stats --- api/handler/layer.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/api/handler/layer.go b/api/handler/layer.go index d98f09c..c075101 100644 --- a/api/handler/layer.go +++ b/api/handler/layer.go @@ -2,7 +2,6 @@ package handler import ( "github.com/labstack/echo/v4" - "github.com/spacemeshos/explorer-backend/api/cache" "github.com/spacemeshos/go-spacemesh/log" "net/http" "strconv" @@ -15,16 +14,11 @@ func LayerStats(c echo.Context) error { return c.NoContent(http.StatusBadRequest) } - if cached, ok := cache.Cache.Get("layerStats" + c.Param("id")); ok { - return c.JSON(http.StatusOK, cached) - } - layerStats, err := cc.StorageClient.GetLayerStats(cc.Storage, int64(lid)) if err != nil { log.Warning("failed to get layer stats: %v", err) return c.NoContent(http.StatusInternalServerError) } - cache.Cache.Set("layerStats"+c.Param("id"), layerStats, 0) return c.JSON(http.StatusOK, layerStats) }