|
@@ -27,7 +27,12 @@ type ThreadPool struct {
|
|
|
}
|
|
|
|
|
|
func job(ctx context.Context) {
|
|
|
- r, err := g.Client().Get(ctx, g.Cfg().MustGet(ctx, "curlAddr").String())
|
|
|
+ client := g.Client()
|
|
|
+ username, password := g.Cfg().MustGet(ctx, "elasticsearch.username").String(), g.Cfg().MustGet(ctx, "elasticsearch.password").String()
|
|
|
+ if username != "" || password != "" {
|
|
|
+ client.SetBasicAuth(username, password)
|
|
|
+ }
|
|
|
+ r, err := client.Get(ctx, g.Cfg().MustGet(ctx, "curlAddr").String())
|
|
|
if err != nil {
|
|
|
g.Log().Errorf(ctx, "请求异常 err:%v", err)
|
|
|
return
|