Skip to content

Commit

Permalink
Fix some bug & improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Sep 9, 2019
1 parent 67ae0e2 commit 99de53f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions oracle/routine.go
Expand Up @@ -96,6 +96,7 @@ func (os *OracleService) startRoutine() {
res, err := os.broadcast(voteMsgs)
if err != nil {
os.Logger.Error("Fail to send vote msgs", err.Error())
os.prevoteInited = false // Retry initialization (prevote msg).
return
}
if tick > res.Height/VotePeriod {
Expand Down
2 changes: 1 addition & 1 deletion price/routine.go
Expand Up @@ -22,7 +22,7 @@ func (ps PriceService) startRoutine() {
// Sleep a bit. It seems that logger is not thread safe.
// Without sleeping, log is often broken.
// By sleeping, mitigate this problem.
time.Sleep(time.Millisecond * 100)
time.Sleep(time.Millisecond * 200)
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion price/types.go
Expand Up @@ -41,6 +41,6 @@ func (meta *SourceMeta) Fetch(logger log.Logger) {
if err != nil {
logger.Error(fmt.Sprintf("Fail to parse price %s from %s: %s", source.Pair(), source.Market(), err.Error()))
}
logger.Info(fmt.Sprintf("Fetch %s from %s: %s", source.Pair(), source.Market(), price))
logger.Info(fmt.Sprintf("Fetch %s from %s: %s", source.Pair(), source.Market(), price), "market", source.Market(), "pair", source.Pair())
}
}

0 comments on commit 99de53f

Please sign in to comment.