When there is no internet connection, go routines will be not closed in the plugin for the new relic.
That affects memory overflow and crashes system.
Review the following code usages from here:
https://github.com/LinMAD/BitAccretion/blob/master/extension/newrelic/provider.go
`
go func(g *model.Graph) {
log.Debug(fmt.Sprintf("Harvesting data from NewRelic API..."))
nr.fetchMetricsWithGraph(g, log)
isProcessed <- true
}(g)
for {
select {
case <-isProcessed:
nr.pluginHealth = model.HealthNormal
return *g, nil
case <-timeout:
log.Error("Timeout got from NewRelic provider...")
nr.pluginHealth = model.HealthWarning
return *g, nil
}
}
`