Skip to content

Commit

Permalink
ebs br: use createTimeStamp of vbk for GC check
Browse files Browse the repository at this point in the history
Signed-off-by: BornChanger <dawn_catcher@126.com>
  • Loading branch information
BornChanger committed Jan 12, 2024
1 parent 1fcdf52 commit 6a39b11
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"sort"
"time"

perrors "github.com/pingcap/errors"
"github.com/pingcap/tidb-operator/pkg/apis/label"
"github.com/pingcap/tidb-operator/pkg/apis/util/config"
"github.com/pingcap/tidb-operator/pkg/util"
Expand Down Expand Up @@ -313,10 +312,7 @@ func calculateExpiredBackups(backupsList []*v1alpha1.VolumeBackup, reservedTime
expiredTS := config.TSToTSO(time.Now().Add(-1 * reservedTime).Unix())
i := 0
for ; i < len(backupsList); i++ {
startTS, err := config.ParseTSString(backupsList[i].Status.CommitTs)
if err != nil {
return nil, perrors.Annotatef(err, "parse start tso: %s", backupsList[i].Status.CommitTs)
}
startTS := config.TSToTSO(backupsList[i].CreationTimestamp.Unix())
if startTS >= expiredTS {
break
}
Expand Down

0 comments on commit 6a39b11

Please sign in to comment.