1
0
Fork 0
mirror of https://github.com/Luzifer/mondash.git synced 2024-12-23 04:21:18 +00:00

Close the reader to ensure we don't spam with open FDs

This commit is contained in:
Knut Ahlers 2015-04-22 22:13:00 +02:00
parent afaa9344c7
commit fad4a6cb8d

View file

@ -45,10 +45,11 @@ func runWelcomePage() {
url := fmt.Sprintf("%s/welcome/beer_available", baseURL) url := fmt.Sprintf("%s/welcome/beer_available", baseURL)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body)) req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body))
req.Header.Add("Authorization", welcomeAPIToken) req.Header.Add("Authorization", welcomeAPIToken)
_, err = http.DefaultClient.Do(req) resp, err := http.DefaultClient.Do(req)
if err != nil { if err != nil {
log.Printf("[WelcomeRunner] %s", err) log.Printf("[WelcomeRunner] %s", err)
} }
resp.Body.Close()
} }
} }