[v10.4.x] Snapshots: Fix panic when snapshot_remove_expired is true (#91329)

Snapshots: Fix panic when snapshot_remove_expired is true (#91232)

(cherry picked from commit bb5d2c83ef)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-07-31 16:40:59 +03:00
committed by GitHub
co-authored by Ryan McKinley
parent 769114b1d7
commit 46bcb54d61
@@ -34,7 +34,7 @@ func NewStore(db db.DB, skipDeleteExpired bool) *DashboardSnapshotStore {
if skipDeleteExpired {
log.Warn("[Deprecated] The snapshot_remove_expired setting is outdated. Please remove from your config.")
}
return &DashboardSnapshotStore{store: db, skipDeleteExpired: skipDeleteExpired}
return &DashboardSnapshotStore{store: db, skipDeleteExpired: skipDeleteExpired, log: log}
}
// DeleteExpiredSnapshots removes snapshots with old expiry dates.