mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 16:06:51 +08:00
optimal es conn pool
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"github.com/lzh-1625/go_process_manager/config"
|
||||
@@ -32,6 +33,11 @@ func (e *esLogic) InitEs() bool {
|
||||
elastic.SetURL(config.CF.EsUrl),
|
||||
elastic.SetBasicAuth(config.CF.EsUsername, config.CF.EsPassword),
|
||||
elastic.SetSniff(false),
|
||||
elastic.SetHttpClient(&http.Client{
|
||||
Transport: &http.Transport{
|
||||
MaxIdleConnsPerHost: config.CF.LogHandlerPoolSize,
|
||||
},
|
||||
}),
|
||||
)
|
||||
if err != nil {
|
||||
config.CF.EsEnable = false
|
||||
|
Reference in New Issue
Block a user