From 87a5e3ce985597b073ccd824f999b8ff4e663831 Mon Sep 17 00:00:00 2001 From: Ketan Umare Date: Fri, 5 Apr 2024 09:47:07 -0700 Subject: [PATCH] fixed ratelimiter config Signed-off-by: Ketan Umare --- .../go/tasks/pluginmachinery/internal/webapi/cache_test.go | 3 ++- flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go index 53e80cd391..d228e7954e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go @@ -21,13 +21,14 @@ func TestNewResourceCache(t *testing.T) { t.Run("Simple", func(t *testing.T) { c, err := NewResourceCache(context.Background(), "Cache1", &mocks.Client{}, webapi.CachingConfig{ Size: 10, - }, promutils.NewTestScope()) + }, webapi.RateLimiterConfig{QPS: 1, Burst: 1}, promutils.NewTestScope()) assert.NoError(t, err) assert.NotNil(t, c) }) t.Run("Error", func(t *testing.T) { _, err := NewResourceCache(context.Background(), "Cache1", &mocks.Client{}, webapi.CachingConfig{}, + webapi.RateLimiterConfig{}, promutils.NewTestScope()) assert.Error(t, err) }) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go index a23f985fc6..9c98521897 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go @@ -191,7 +191,7 @@ func createRemotePlugin(pluginEntry webapi.PluginEntry, c clock.Clock) core.Plug } resourceCache, err := NewResourceCache(ctx, pluginEntry.ID, p, p.GetConfig().Caching, - iCtx.MetricsScope().NewSubScope("cache")) + p.GetConfig().ReadRateLimiter, iCtx.MetricsScope().NewSubScope("cache")) if err != nil { return nil, err