From 2f614a5c752bb910bc727eaa939d912f3f25c9d5 Mon Sep 17 00:00:00 2001 From: likhachevam Date: Fri, 21 Nov 2025 13:24:32 +0300 Subject: [PATCH] MSP-6703 update clearInterval format --- assembly/locator.go | 3 +-- conf/config.yml | 2 +- service/rqlite/config_flags.go | 18 +++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/assembly/locator.go b/assembly/locator.go index 59d6cf0..1a4b73a 100644 --- a/assembly/locator.go +++ b/assembly/locator.go @@ -187,8 +187,7 @@ func (l Locator) Config() *Config { cleanEventWorker := worker.New(cleanerJob, worker.WithInterval(cleanEventInterval)) cleanBackupsJob := event.NewBackupCleaner(l.leaderChecker, l.cfg.Local.Backup, l.logger) - cleanBackupsWorker := worker.New(cleanBackupsJob, - worker.WithInterval(time.Duration(l.cfg.Local.Backup.ClearIntervalDays)*24*time.Hour)) + cleanBackupsWorker := worker.New(cleanBackupsJob, worker.WithInterval(l.cfg.Local.Backup.ClearInterval)) metricsSvc := metrics.New(backendRepo) metricsController := controller.NewMetrics(metricsSvc) diff --git a/conf/config.yml b/conf/config.yml index fac082c..c6dee3a 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -41,7 +41,7 @@ backup: Enabled: true Amount: 5 Interval: "24h" - ClearIntervalDays: 7 + ClearInterval: "168h" Sub: Dir: "/app/data/backups/rqlite" Name: "backup.sqlite.gz" diff --git a/service/rqlite/config_flags.go b/service/rqlite/config_flags.go index 9415a7c..5011c07 100644 --- a/service/rqlite/config_flags.go +++ b/service/rqlite/config_flags.go @@ -201,15 +201,15 @@ type Config struct { } type Backup struct { - Enabled bool - Amount int - Version int - Type string - Interval string - ClearIntervalDays int - Timestamp bool - Vacuum bool - Sub Sub + Enabled bool + Amount int + Version int + Type string + Interval string + ClearInterval time.Duration + Timestamp bool + Vacuum bool + Sub Sub } type Sub struct {