Skip to content

Commit

Permalink
revert: "feat(mqtt): enable dialer pool for everyone (#4565)" (#4582)
Browse files Browse the repository at this point in the history
This reverts commit dc08c57.
  • Loading branch information
jsternberg authored Mar 22, 2022
1 parent 1f921a2 commit 5e19bfa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dependencies/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/influxdata/flux/codes"
"github.com/influxdata/flux/dependency"
"github.com/influxdata/flux/internal/errors"
"github.com/influxdata/flux/internal/feature"
)

const (
Expand All @@ -25,9 +26,11 @@ const clientKey key = iota

// Inject will inject this Dialer into the dependency chain.
func Inject(ctx context.Context, dialer Dialer) context.Context {
pool := newPoolDialer(dialer)
dependency.OnFinish(ctx, pool)
dialer = pool
if feature.MqttPoolDialer().Enabled(ctx) {
pool := newPoolDialer(dialer)
dependency.OnFinish(ctx, pool)
dialer = pool
}
return context.WithValue(ctx, clientKey, dialer)
}

Expand Down
14 changes: 14 additions & 0 deletions internal/feature/flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions internal/feature/flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
default: false
contact: Jonathan Sternberg

- name: MQTT Pool Dialer
description: MQTT pool dialer
key: mqttPoolDialer
default: false
contact: Jonathan Sternberg

- name: Vectorized Map
description: Enables the version of map that supports vectorized functions
key: vectorizedMap
Expand Down

0 comments on commit 5e19bfa

Please sign in to comment.