snapshots: fixes cleanup of old snapshots

Snapshot cleanup did not work due to time.Now syntax error. Added test
for it as well to catch any future errors.

Added error and debug logging so that it is possible to see any errors in the future.

Removed an unused configuration value and deprecated the remove expired snapshots
setting.
This commit is contained in:
Daniel Lee
2018-02-20 23:10:59 +01:00
parent 7d9a9fa29c
commit fe49182b9d
10 changed files with 94 additions and 27 deletions

View File

@ -88,7 +88,6 @@ var (
ExternalSnapshotUrl string
ExternalSnapshotName string
ExternalEnabled bool
SnapShotTTLDays int
SnapShotRemoveExpired bool
// Dashboard history
@ -523,7 +522,6 @@ func NewConfigContext(args *CommandLineArgs) error {
ExternalSnapshotName = snapshots.Key("external_snapshot_name").String()
ExternalEnabled = snapshots.Key("external_enabled").MustBool(true)
SnapShotRemoveExpired = snapshots.Key("snapshot_remove_expired").MustBool(true)
SnapShotTTLDays = snapshots.Key("snapshot_TTL_days").MustInt(90)
// read dashboard settings
dashboards := Cfg.Section("dashboards")