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 da54c1e
Showing 1 changed file with 12 additions and 14 deletions.
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(
// &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 da54c1e

Please sign in to comment.