Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmtszr committed Aug 9, 2023
1 parent ca93ba7 commit c93aca0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions elasticsearch/bulk/bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ var bytesPool = sync.Pool{
New: func() interface{} { return []byte{} },
}

//nolint:ineffassign
func getEsActionJSON(
docID []byte,
action document.EsAction,
Expand All @@ -186,9 +185,9 @@ func getEsActionJSON(
) []byte {
meta := (bytesPool.Get().([]byte))[:0]
if action == document.Index {
meta = indexPrefix
meta = append(meta, indexPrefix...)
} else {
meta = deletePrefix
meta = append(meta, deletePrefix...)
}
meta = append(meta, helper.Byte(indexName)...)
meta = append(meta, idPrefix...)
Expand Down

0 comments on commit c93aca0

Please sign in to comment.