Skip to content

Commit

Permalink
fix(output): use pointer for false keepAlive config
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Aug 8, 2023
1 parent 765b78d commit f923e85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/output/http/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Config struct {
ExportTimeout time.Duration `yaml:"exportTimeout" default:"30s"`
MaxExportBatchSize int `yaml:"maxExportBatchSize" default:"512"`
Compression CompressionStrategy `yaml:"compression" default:"none"`
KeepAlive bool `yaml:"keepAlive" default:"true"`
KeepAlive *bool `yaml:"keepAlive" default:"true"`
}

func (c *Config) Validate() error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/output/http/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ItemExporter struct {

func NewItemExporter(name string, config *Config, log logrus.FieldLogger) (ItemExporter, error) {
t := http.DefaultTransport.(*http.Transport).Clone()
if !config.KeepAlive {
if config.KeepAlive != nil && !*config.KeepAlive {
t.DisableKeepAlives = true
}

Expand Down

0 comments on commit f923e85

Please sign in to comment.