Add env. variable to disable data usage crawling (#9086)

master
kannappanr 5 years ago committed by GitHub
parent 9fc7537f2a
commit d9be8bc693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      cmd/data-usage.go

@ -25,16 +25,23 @@ import (
"time" "time"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/minio/minio/cmd/config"
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/env"
"github.com/minio/minio/pkg/hash" "github.com/minio/minio/pkg/hash"
) )
const ( const (
dataUsageObjName = "data-usage" dataUsageObjName = "data-usage"
dataUsageCrawlInterval = 12 * time.Hour dataUsageCrawlInterval = 12 * time.Hour
dataUsageCrawlConf = "MINIO_DISK_USAGE_CRAWL"
) )
func initDataUsageStats() { func initDataUsageStats() {
dataUsageEnabled, err := config.ParseBool(env.Get(dataUsageCrawlConf, config.EnableOn))
if err == nil && !dataUsageEnabled {
return
}
go runDataUsageInfoUpdateRoutine() go runDataUsageInfoUpdateRoutine()
} }

Loading…
Cancel
Save