Fix snapshotter initialization and remove initial snapshot on startup

- Remove immediate snapshot when periodic goroutine starts
- Fix variable shadowing issue in snapshotter creation
- Add debug logging for snapshotter shutdown
- Snapshots now only occur after 10 minutes or on shutdown
This commit is contained in:
2025-07-28 00:06:39 +02:00
parent ae2ef2ae0c
commit 52cdcd5785
2 changed files with 6 additions and 7 deletions

View File

@@ -115,11 +115,7 @@ func (s *Snapshotter) periodicSnapshot() {
ticker := time.NewTicker(snapshotInterval)
defer ticker.Stop()
// Take an initial snapshot
if err := s.TakeSnapshot(); err != nil {
s.logger.Error("Failed to take initial snapshot", "error", err)
}
// Wait for the first interval before taking any snapshots
for {
select {
case <-s.ctx.Done():