Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer committed Mar 12, 2020
1 parent 587aedc commit c31b202
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/task/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func DefineBackupFlags(flags *pflag.FlagSet) {
"The history version of the backup task, e.g. 1m, 1h. Do not exceed GCSafePoint")

// TODO: remove experimental tag if it's stable
flags.Uint64(flagLastBackupTS, 0, "(experimental) the last time backup ts, use for incremental backup, support TSO only")
flags.Uint64(flagLastBackupTS, 0, "(experimental) the last time backup ts,"+
" use for incremental backup, support TSO only")
flags.String(flagBackupTS, "", "the backup ts support TSO or datetime,"+
" e.g. '400036290571534337', '2018-05-11 01:42:23' ")
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/task/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package task

import (
"testing"
"time"

. "github.com/pingcap/check"
)
Expand All @@ -28,7 +29,9 @@ func (s *testBackupSuite) TestParseTSString(c *C) {
c.Assert(err, IsNil)
c.Assert(int(ts), Equals, 400036290571534337)

utcTS := 400024965742563200
_, offset := time.Now().Local().Zone()
ts, err = parseTSString("2018-05-11 01:42:23")
c.Assert(err, IsNil)
c.Assert(int(ts), Equals, 400024965742592000)
c.Assert(int(ts), Equals, utcTS+offset)
}

0 comments on commit c31b202

Please sign in to comment.