Don't crash when metrics log not writable
@@ -633,8 +633,7 @@ func (b *Backend) runOnce() error {
metricsLogWriter, err := logging.NewRotateWriter(b.Cfg.PlatformMetricsLogFile, sighup)
if err != nil {
logger.WithError(err).Error("unable to open platform metrics log file")
- return err
- }
+ } else {
defer metricsLogWriter.Close()
metricsBridge, err := metrics.NewInfluxBridge(&metrics.InfluxBridgeConfig{
Writer: metricsLogWriter,
@@ -649,6 +648,7 @@ func (b *Backend) runOnce() error {
}
go metricsBridge.Run(b.RunContext())
}
+ }
// Reverse the order of our stopGroup so daemons are stopped in the proper
// order (last one started is first one stopped)
