diff --git a/.gitignore b/.gitignore index 47b47c3..cf18e38 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ *.so *.dylib +# IDE related +.idea + # Test binary, built with `go test -c` *.test diff --git a/internal/client/client.go b/internal/client/client.go index 68a7dc0..7363056 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -37,7 +37,6 @@ func (client *Client) Run(terminate chan<- error, routineUpdate chan<- []model.G terminate <- fmt.Errorf("Failed to list go routines. Err: %s", err.Error()) return } - defer resp.Body.Close() goroutines, err := model.ParseStackFrame(resp.Body) if err != nil { @@ -45,6 +44,8 @@ func (client *Client) Run(terminate chan<- error, routineUpdate chan<- []model.G } else { routineUpdate <- goroutines } + + resp.Body.Close() <-ticker.C } }