Ensure proper stale_uploads_cleanup_interval is used at all times (#20451)

This commit is contained in:
Ramon de Klein
2024-09-18 19:59:26 +02:00
committed by GitHub
parent fa5d9c02ef
commit 48a591e9b4
2 changed files with 16 additions and 4 deletions

View File

@@ -86,6 +86,8 @@ type erasureSets struct {
lastConnectDisksOpTime time.Time
}
var staleUploadsCleanupIntervalChangedCh = make(chan struct{})
func (s *erasureSets) getDiskMap() map[Endpoint]StorageAPI {
diskMap := make(map[Endpoint]StorageAPI)
@@ -532,10 +534,11 @@ func (s *erasureSets) cleanupStaleUploads(ctx context.Context) {
}(set)
}
wg.Wait()
// Reset for the next interval
timer.Reset(globalAPIConfig.getStaleUploadsCleanupInterval())
case <-staleUploadsCleanupIntervalChangedCh:
}
// Reset for the next interval
timer.Reset(globalAPIConfig.getStaleUploadsCleanupInterval())
}
}