mirror of
https://github.com/zhengkai/orca.git
synced 2026-02-04 15:02:26 +08:00
fix es body close
This commit is contained in:
@@ -25,9 +25,10 @@ func Insert(d *pb.EsMetrics) {
|
|||||||
|
|
||||||
index := indexName(uint32(d.Ts / 1000))
|
index := indexName(uint32(d.Ts / 1000))
|
||||||
|
|
||||||
_, err = theClient.Index(index, bytes.NewReader(ab))
|
re, err := theClient.Index(index, bytes.NewReader(ab))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zj.W(`insert fail:`, err)
|
zj.W(`insert fail:`, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
re.Body.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ func Test() {
|
|||||||
}
|
}
|
||||||
Insert(d)
|
Insert(d)
|
||||||
|
|
||||||
time.Sleep(time.Second / 2)
|
time.Sleep(time.Second / 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user