1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-23 20:38:55 +00:00

Better gc (#717)

* More error wrapping for SQL cache

* Use context.Context instead of stopCh

* Move CacheFor to Info log level

* Implement time-based GC

* Set default GC param when running standalone steve
This commit is contained in:
Tom Lebreux
2025-07-11 12:48:19 -04:00
committed by GitHub
parent 3692666375
commit 127d37391d
9 changed files with 170 additions and 195 deletions

View File

@@ -2,10 +2,12 @@ package cli
import (
"context"
"time"
steveauth "github.com/rancher/steve/pkg/auth"
authcli "github.com/rancher/steve/pkg/auth/cli"
"github.com/rancher/steve/pkg/server"
"github.com/rancher/steve/pkg/sqlcache/informer/factory"
"github.com/rancher/steve/pkg/ui"
"github.com/rancher/wrangler/v3/pkg/kubeconfig"
"github.com/rancher/wrangler/v3/pkg/ratelimit"
@@ -52,6 +54,10 @@ func (c *Config) ToServer(ctx context.Context, sqlCache bool) (*server.Server, e
AuthMiddleware: auth,
Next: ui.New(c.UIPath),
SQLCache: sqlCache,
SQLCacheFactoryOptions: factory.CacheFactoryOptions{
GCInterval: 15 * time.Minute,
GCKeepCount: 1000,
},
})
}