Commit e41d81df authored by Eric's avatar Eric

fix replay bugs

parent 83af348a
...@@ -114,7 +114,8 @@ func (r *ReplyRecorder) Record(b []byte) { ...@@ -114,7 +114,8 @@ func (r *ReplyRecorder) Record(b []byte) {
if len(b) > 0 { if len(b) > 0 {
delta := float64(time.Now().UnixNano()-r.timeStartNano) / 1000 / 1000 / 1000 delta := float64(time.Now().UnixNano()-r.timeStartNano) / 1000 / 1000 / 1000
data, _ := json.Marshal(string(b)) data, _ := json.Marshal(string(b))
_, _ = r.file.WriteString(fmt.Sprintf(`"%.3f":%s,`, delta, data)) _, _ = r.file.WriteString(fmt.Sprintf(`"%f":%s,`, delta, data))
_ = r.file.Sync()
} }
} }
...@@ -145,7 +146,7 @@ func (r *ReplyRecorder) prepare() { ...@@ -145,7 +146,7 @@ func (r *ReplyRecorder) prepare() {
} }
func (r *ReplyRecorder) End() { func (r *ReplyRecorder) End() {
_, _ = r.file.WriteString(fmt.Sprintf(`"%.3f":%s}`, 0.0, `""`)) _, _ = r.file.WriteString(fmt.Sprintf(`"%f":%s}`, 0.0, `""`))
_ = r.file.Close() _ = r.file.Close()
go r.uploadReplay() go r.uploadReplay()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment