From 3510844535e8e952d3762bc27941dbd0ae545e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Thu, 19 Dec 2024 11:51:05 +0100 Subject: [PATCH] debug: Disable cache --- go.mod | 2 +- .../sink/type/tablesink/keboola/bridge/bridge.go | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 496533ebcc..048a971f18 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 github.com/coder/websocket v1.8.12 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc - github.com/dgraph-io/ristretto/v2 v2.0.0 github.com/fatih/color v1.18.0 github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 @@ -221,6 +220,7 @@ require ( github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/creack/pty v1.1.18 // indirect + github.com/dgraph-io/ristretto/v2 v2.0.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/disintegration/imaging v1.6.2 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect diff --git a/internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go b/internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go index 07983a5b3b..a575ba52fd 100644 --- a/internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go +++ b/internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go @@ -3,9 +3,7 @@ package bridge import ( "context" "sync" - "time" - "github.com/dgraph-io/ristretto/v2" "github.com/keboola/go-client/pkg/keboola" "github.com/keboola/go-cloud-encrypt/pkg/cloudencrypt" etcd "go.etcd.io/etcd/client/v3" @@ -83,18 +81,6 @@ func New(d dependencies, apiProvider apiProvider, config keboolasink.Config) (*B encryptor := d.Encryptor() if encryptor != nil { - cache, err := ristretto.NewCache( - &ristretto.Config[[]byte, []byte]{ - NumCounters: 1e6, - MaxCost: 1 << 20, - BufferItems: 64, - }, - ) - if err != nil { - return nil, err - } - - encryptor = cloudencrypt.NewCachedEncryptor(encryptor, time.Hour, cache) tokenEncryptor = cloudencrypt.NewGenericEncryptor[keboola.Token](encryptor) credentialsEncryptor = cloudencrypt.NewGenericEncryptor[keboola.FileUploadCredentials](encryptor) }