Skip to content

Commit

Permalink
Merge branch '2437-iss-default-enable-point-pool' into 'dev'
Browse files Browse the repository at this point in the history
Resolve "1.60.0 几个已有问题修复"

See merge request cloudcare-tools/datakit!3252
  • Loading branch information
谭彪 committed Oct 30, 2024
2 parents 4989403 + fd4f20b commit f3c1b66
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/installer/installer/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func Upgrade() error {
}

func upgradeMainConfig(c *config.Config) *config.Config {
if c.PointPool != nil {
l.Infof("default enable point pool")
c.PointPool.Enable = true // default enable point-pool
}

// setup dataway
if c.Dataway != nil {
c.Dataway.DeprecatedURL = ""
Expand Down
15 changes: 15 additions & 0 deletions cmd/installer/installer/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,21 @@ func TestUpgradeMainConfig(t *T.T) {
return c
}(),
},

{
name: "default-enable-point-pool",
old: func() *config.Config {
c := config.DefaultConfig()
c.PointPool.Enable = false

return c
}(),

expect: func() *config.Config {
c := config.DefaultConfig()
return c
}(),
},
}

for _, tc := range cases {
Expand Down
2 changes: 1 addition & 1 deletion cmd/make/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func Compile() error {
}

if err := compileAPMInject(goos, goarch, BuildDir); err != nil {
return err
l.Warnf("build APM inject failed: %s, ignored", err)
}

upgraderDir := fmt.Sprintf("%s/%s-%s-%s", BuildDir, upgrader.BuildBinName, goos, goarch)
Expand Down
4 changes: 4 additions & 0 deletions internal/io/dataway/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func (dw *Dataway) doFlush(w *writer, b *body, opts ...WriteOption) error {
}

isGzip := "F"
if w.cacheClean {
isGzip = "T" // fail-cache always gzipped before HTTP POST
}

if dw.GZip && !w.cacheClean { // under cacheClean, all body has been gzipped during previous POST
var (
zstart = time.Now()
Expand Down

0 comments on commit f3c1b66

Please sign in to comment.