Skip to content

Commit

Permalink
rewrite code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany committed Sep 8, 2018
1 parent ed136b9 commit 8ba623f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ func zone(sctx sessionctx.Context) (string, int64) {
if name == "Local" {
localOnce.Do(func() {
path, err := filepath.EvalSymlinks("/etc/localtime")
if err != nil {
log.Errorln(err)
localStr = "System"
}
localStr, err = GetTZNameFromFileName(path)
if err != nil {
log.Errorln(err)
localStr = "System"
if err == nil {
localStr, err = GetTZNameFromFileName(path)
if err == nil {
return
}
}
localStr = "System"
})

return localStr, int64(offset)
Expand Down

0 comments on commit 8ba623f

Please sign in to comment.