mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-15 04:17:30 +01:00
Make checkpointInterval an option config option again.
Also applies small fixes Entire-Checkpoint: c11d1a65fae4
This commit is contained in:
@@ -100,8 +100,15 @@ func Checkpointing(wg *sync.WaitGroup, ctx context.Context) {
|
||||
|
||||
wg.Go(func() {
|
||||
|
||||
const checkpointInterval = 12 * time.Hour
|
||||
d := checkpointInterval
|
||||
d := 12 * time.Hour // default checkpoint interval
|
||||
if Keys.CheckpointInterval != "" {
|
||||
parsed, err := time.ParseDuration(Keys.CheckpointInterval)
|
||||
if err != nil {
|
||||
cclog.Errorf("[METRICSTORE]> invalid checkpoint-interval %q: %s, using default 12h", Keys.CheckpointInterval, err)
|
||||
} else {
|
||||
d = parsed
|
||||
}
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(d)
|
||||
defer ticker.Stop()
|
||||
|
||||
Reference in New Issue
Block a user