Skip to content

Commit

Permalink
fix: sorting len
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Nov 10, 2024
1 parent 6a36ad6 commit 9362f14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions external/vaults/prepare.getVaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -220,7 +218,6 @@ func getVaults(
}
data = data[start:end]

logs.Pretty(len(data))
return data
}

Expand Down

0 comments on commit 9362f14

Please sign in to comment.