Compare commits

..

6 Commits

Author SHA1 Message Date
Frederik Ring
01e41f45d1 Periodically collect runtime info when requested 2024-02-10 12:10:16 +01:00
Frederik Ring
68ba6ce5a1 Docker client expects to be closed after usage in long running program 2024-02-09 20:55:37 +01:00
Frederik Ring
7cfea62933 Hoist control for exiting script a level up (#348)
* Hoist control for exiting script a level up

* Do not accidentally nil out errors

* Log when running schedule

* Remove duplicate log line

* Warn on cron schedule that will never run
2024-02-09 10:24:28 +01:00
Frederik Ring
d14e826529 Tidy go.mod 2024-02-07 17:57:59 +01:00
Frederik Ring
21191d601a Entrypoint script is not needed anymore (#346) 2024-02-06 21:46:18 +01:00
pixxon
d642a60c4d Move cron scheduling inside application (#338)
* Move cron scheduling inside application

* Make envvar a fallback and check for errors

* Panic significantly less

* propagate error out of runBackup

* Add structured logging

* FIx error propagation to exit

* Enable the new scheduler by default

* Review fixes

* Added docs and better error propagation
2024-02-06 21:05:38 +01:00

View File

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