@@ -52,9 +52,11 @@ import (
5252const (
5353 repoSyncPeriod = 5 * time .Minute
5454 defaultMaintainFrequency = 7 * 24 * time .Hour
55- defaultMaintenanceStatusQueueLength = 3
55+ defaultMaintenanceStatusQueueLength = 25
5656)
5757
58+ var maintenanceStatusQueueLength = defaultMaintenanceStatusQueueLength
59+
5860type BackupRepoReconciler struct {
5961 client.Client
6062 namespace string
@@ -369,7 +371,7 @@ func ensureRepo(repo *velerov1api.BackupRepository, repoManager repomanager.Mana
369371}
370372
371373func (r * BackupRepoReconciler ) recallMaintenance (ctx context.Context , req * velerov1api.BackupRepository , log logrus.FieldLogger ) error {
372- history , err := maintenance .WaitAllJobsComplete (ctx , r .Client , req , defaultMaintenanceStatusQueueLength , log )
374+ history , err := maintenance .WaitAllJobsComplete (ctx , r .Client , req , maintenanceStatusQueueLength , log )
373375 if err != nil {
374376 return errors .Wrapf (err , "error waiting incomplete repo maintenance job for repo %s" , req .Name )
375377 }
@@ -427,7 +429,7 @@ func consolidateHistory(coming, cur []velerov1api.BackupRepositoryMaintenanceSta
427429
428430 truncated := []velerov1api.BackupRepositoryMaintenanceStatus {}
429431 for consolidator .Len () > 0 {
430- if len (truncated ) == defaultMaintenanceStatusQueueLength {
432+ if len (truncated ) == maintenanceStatusQueueLength {
431433 break
432434 }
433435
@@ -537,8 +539,8 @@ func updateRepoMaintenanceHistory(repo *velerov1api.BackupRepository, result vel
537539 }
538540
539541 startingPos := 0
540- if len (repo .Status .RecentMaintenance ) >= defaultMaintenanceStatusQueueLength {
541- startingPos = len (repo .Status .RecentMaintenance ) - defaultMaintenanceStatusQueueLength + 1
542+ if len (repo .Status .RecentMaintenance ) >= maintenanceStatusQueueLength {
543+ startingPos = len (repo .Status .RecentMaintenance ) - maintenanceStatusQueueLength + 1
542544 }
543545
544546 repo .Status .RecentMaintenance = append (repo .Status .RecentMaintenance [startingPos :], latest )
0 commit comments