Skip to content

Commit

Permalink
debug: Disable cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jachym-tousek-keboola committed Dec 19, 2024
1 parent 5a42cae commit 2d37a0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -83,18 +81,18 @@ 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)
//cache, err := ristretto.NewCache(

Check failure on line 84 in internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go

View workflow job for this annotation

GitHub Actions / Lint / lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 84 in internal/pkg/service/stream/sink/type/tablesink/keboola/bridge/bridge.go

View workflow job for this annotation

GitHub Actions / Lint / lint

commentFormatting: put a space between `//` and comment text (gocritic)
// &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)
}
Expand Down

0 comments on commit 2d37a0b

Please sign in to comment.