Skip to content

Commit

Permalink
tiny clean
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed May 16, 2017
1 parent e230a47 commit 5b6b0ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ func (s *Server) GetRaftClusterBootstrapTime() (time.Time, error) {
if err != nil {
return zeroTime, errors.Trace(err)
}
if len(data) == 0 {
return zeroTime, ErrNotBootstrapped
}
return parseTimestamp(data)
}

Expand Down
3 changes: 3 additions & 0 deletions server/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func (s *Server) loadTimestamp() (time.Time, error) {
if err != nil {
return zeroTime, errors.Trace(err)
}
if len(data) == 0 {
return zeroTime, nil
}
return parseTimestamp(data)
}

Expand Down
3 changes: 0 additions & 3 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ func diffRegionKeyInfo(origin *RegionInfo, other *RegionInfo) string {
}

func parseTimestamp(data []byte) (time.Time, error) {
if len(data) == 0 {
return zeroTime, nil
}
nano, err := bytesToUint64(data)
if err != nil {
return zeroTime, errors.Trace(err)
Expand Down

0 comments on commit 5b6b0ad

Please sign in to comment.