Possible error on scheduling profiling job is unchecked

This commit is contained in:
Frederik Ring 2024-02-10 12:19:40 +01:00
parent 01e41f45d1
commit d3e82c0c5c

View File

@ -191,7 +191,7 @@ func (c *command) runInForeground(profileCronExpression string) error {
}
if profileCronExpression != "" {
cr.AddFunc(profileCronExpression, func() {
if _, err := cr.AddFunc(profileCronExpression, func() {
memStats := runtime.MemStats{}
runtime.ReadMemStats(&memStats)
c.logger.Info(
@ -205,7 +205,9 @@ func (c *command) runInForeground(profileCronExpression string) error {
"memory_heap_sys",
formatBytes(memStats.HeapSys, false),
)
})
}); err != nil {
return fmt.Errorf("runInForeground: error adding profiling job: %w", err)
}
}
var quit = make(chan os.Signal, 1)