diff --git a/cmd/server.go b/cmd/server.go index 1d654ffe..9f3a32db 100755 --- a/cmd/server.go +++ b/cmd/server.go @@ -16,11 +16,12 @@ import ( "github.com/yearn/ydaemon/external/vaults" ) +var cachingStore = cache.New(1*time.Minute, 5*time.Minute) + /************************************************************************************************** ** NewRouter create the routes and setup the server **************************************************************************************************/ func NewRouter() *gin.Engine { - cachingStore := cache.New(1*time.Minute, 5*time.Minute) gin.EnableJsonDecoderDisallowUnknownFields() gin.SetMode(gin.ReleaseMode) @@ -30,7 +31,7 @@ func NewRouter() *gin.Engine { router.Use(gin.Recovery()) corsConf := cors.Config{ AllowAllOrigins: true, - AllowMethods: []string{"GET", "HEAD", "POST"}, + AllowMethods: []string{"GET", "HEAD", "POST", "OPTIONS"}, AllowHeaders: []string{`Origin`, `Content-Length`, `Content-Type`, `Authorization`}, } router.Use(cors.New(corsConf)) diff --git a/external/vaults/prepare.getVaults.go b/external/vaults/prepare.getVaults.go index 730b2202..90b8a02e 100644 --- a/external/vaults/prepare.getVaults.go +++ b/external/vaults/prepare.getVaults.go @@ -8,7 +8,6 @@ import ( "github.com/gin-gonic/gin" "github.com/yearn/ydaemon/common/env" "github.com/yearn/ydaemon/common/helpers" - "github.com/yearn/ydaemon/common/logs" "github.com/yearn/ydaemon/common/sort" "github.com/yearn/ydaemon/internal/models" "github.com/yearn/ydaemon/internal/storage" @@ -128,7 +127,6 @@ func getVaults( } newVault, err := NewVault().AssignTVault(currentVault) if err != nil { - logs.Error(`Impossible to assign TVault`, err) continue } if migrable == `none` && (newVault.Details.IsHidden || newVault.Details.IsRetired) && hideAlways { @@ -220,7 +218,6 @@ func getVaults( } data = data[start:end] - logs.Pretty(len(data)) return data }