disable collector correctly
This commit is contained in:
parent
3384cc92e7
commit
52468bb63e
@ -46,9 +46,6 @@ func (settings *AppSettings) validateFlags() {
|
||||
minServerPort, maxServerPort, settings.MetricsPort)
|
||||
flagsValid = false
|
||||
}
|
||||
if settings.FileCollectorPath != "" {
|
||||
settings.FileCollectorEnabled = true
|
||||
}
|
||||
if settings.FileCollectorEnabled && settings.FileCollectorPath == "" {
|
||||
fmt.Printf("file collector directory path must not be empty if collector enabled\n")
|
||||
flagsValid = false
|
||||
|
@ -9,6 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func (c *Collector) WriteTextFileMetrics(w http.ResponseWriter, r *http.Request) {
|
||||
if !c.enabled {
|
||||
return
|
||||
}
|
||||
|
||||
files, err := ioutil.ReadDir(c.folderPath)
|
||||
if err != nil {
|
||||
c.appendErrorForPath(c.folderPath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user