diff --git a/buildup/Dockerfile b/buildup/Dockerfile index 27a165b..a72fd06 100644 --- a/buildup/Dockerfile +++ b/buildup/Dockerfile @@ -13,8 +13,6 @@ FROM busybox # Installer le logiciel compilé COPY src/www /www -COPY src/.env / -COPY src/servers.yaml / COPY --from=builder /go/bin/buildup /buildup # Partages diff --git a/buildup/src/goroutines/cpu.go b/buildup/src/goroutines/cpu.go index 377eb9b..4047ca9 100644 --- a/buildup/src/goroutines/cpu.go +++ b/buildup/src/goroutines/cpu.go @@ -30,7 +30,7 @@ func GoCPU(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN s log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var cpu cpu.CPUInfo if err := json.NewDecoder(resp.Body).Decode(&cpu); err != nil { diff --git a/buildup/src/goroutines/disk.go b/buildup/src/goroutines/disk.go index 617e47d..ad377d0 100644 --- a/buildup/src/goroutines/disk.go +++ b/buildup/src/goroutines/disk.go @@ -30,7 +30,7 @@ func GoDisk(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var disks []disk.DiskFS if err := json.NewDecoder(resp.Body).Decode(&disks); err != nil { diff --git a/buildup/src/goroutines/load.go b/buildup/src/goroutines/load.go index cd12f8f..b4a9478 100644 --- a/buildup/src/goroutines/load.go +++ b/buildup/src/goroutines/load.go @@ -30,7 +30,7 @@ func GoLoad(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var avg load.LoadInfo if err := json.NewDecoder(resp.Body).Decode(&avg); err != nil { diff --git a/buildup/src/goroutines/mem.go b/buildup/src/goroutines/mem.go index 1ef63b6..f4b86ec 100644 --- a/buildup/src/goroutines/mem.go +++ b/buildup/src/goroutines/mem.go @@ -30,7 +30,7 @@ func GoMem(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN s log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var mem memory.MemInfo if err := json.NewDecoder(resp.Body).Decode(&mem); err != nil { diff --git a/buildup/src/goroutines/net.go b/buildup/src/goroutines/net.go index d58e099..83cc606 100644 --- a/buildup/src/goroutines/net.go +++ b/buildup/src/goroutines/net.go @@ -31,7 +31,7 @@ func GoNet(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN s log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var nets []netcard.NetCard if err := json.NewDecoder(resp.Body).Decode(&nets); err != nil { diff --git a/buildup/src/goroutines/procs.go b/buildup/src/goroutines/procs.go index 5fe27ed..7338526 100644 --- a/buildup/src/goroutines/procs.go +++ b/buildup/src/goroutines/procs.go @@ -31,7 +31,7 @@ func GoProc(server, INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN log.Println("Erreur de communication : " + reqUrl) continue } - defer resp.Body.Close() + resp.Body.Close() var procs []proc.Proc if err := json.NewDecoder(resp.Body).Decode(&procs); err != nil {