diff --git a/pkg/drivers/nats/new.go b/pkg/drivers/nats/new.go index 977d9956..5a8838db 100644 --- a/pkg/drivers/nats/new.go +++ b/pkg/drivers/nats/new.go @@ -149,10 +149,6 @@ func newBackend(ctx context.Context, connection string, tlsInfo tls.Config, lega cancel() return nil, fmt.Errorf("failed to get or create bucket: %w", err) } - if err := disableDirectGets(ctx, js, config); err != nil { - cancel() - return nil, fmt.Errorf("failed to disable direct gets: %w", err) - } logrus.Infof("bucket initialized: %s", config.bucket) @@ -231,28 +227,3 @@ func getOrCreateBucket(ctx context.Context, js jetstream.JetStream, config *Conf } } } - -func disableDirectGets(ctx context.Context, js jetstream.JetStream, config *Config) error { - for { - str, err := js.Stream(ctx, fmt.Sprintf("KV_%s", config.bucket)) - if errors.Is(err, context.DeadlineExceeded) { - continue - } - if err != nil { - return fmt.Errorf("failed to get stream info: %w", err) - } - - scfg := str.CachedInfo().Config - scfg.AllowDirect = false - - _, err = js.UpdateStream(ctx, scfg) - if errors.Is(err, context.DeadlineExceeded) { - continue - } - if err != nil { - return fmt.Errorf("failed to update stream config: %w", err) - } - - return nil - } -}