From 5c95f682a5a4079090d9fabfbb79e917b0a71904 Mon Sep 17 00:00:00 2001 From: lucas Date: Mon, 18 Nov 2024 12:21:25 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B7=BB=E5=8A=A0=20es=20=E5=86=99?= =?UTF-8?q?=E5=85=A5=E8=BF=94=E5=9B=9E=E7=BA=AA=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbHelper/elasticsearchHelper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbHelper/elasticsearchHelper.go b/dbHelper/elasticsearchHelper.go index 7f0d512..1042bf8 100644 --- a/dbHelper/elasticsearchHelper.go +++ b/dbHelper/elasticsearchHelper.go @@ -185,13 +185,13 @@ func (the *ESHelper) BulkWrite(index, reqBody string) { defer res.Body.Close() if err != nil { log.Panicf("es 写入[%s],err=%s", index, err.Error()) + return } - + respBody, _ := io.ReadAll(res.Body) if res.StatusCode != 200 && res.StatusCode != 201 { - respBody, _ := io.ReadAll(res.Body) log.Panicf("es 写入失败,err=%s \n body=%s", string(respBody), reqBody) } - //log.Printf("es 写入[%s],字符长度=%d,完成", index, len(reqBody)) + log.Printf("es 写入[%s],完成,res=%s ", index, reqBody) }