mirror of
https://github.com/eolinker/apinto
synced 2025-09-26 12:51:12 +08:00
nacos输出报错信息
This commit is contained in:
@@ -103,7 +103,7 @@ func (n *executor) Start() error {
|
||||
for _, serviceName := range keys {
|
||||
res, err := n.client.GetNodeList(serviceName)
|
||||
if err != nil {
|
||||
log.Warnf("executor %s:%w for service %s", n.Name(), discovery.ErrDiscoveryDown, serviceName)
|
||||
log.Warnf("executor %s:%v for service %s,err:%v", n.Name(), discovery.ErrDiscoveryDown, serviceName, err)
|
||||
}
|
||||
//更新目标服务的节点列表
|
||||
n.services.Set(serviceName, res)
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
maxBufSize = 32
|
||||
maxBufSize = 4 * 1024 * 1024 // 4M
|
||||
)
|
||||
|
||||
type Writer struct {
|
||||
@@ -26,6 +26,7 @@ type Writer struct {
|
||||
//multiBodySize int64
|
||||
//multiBodies []multiBody
|
||||
bodyChan chan []byte
|
||||
bodySize int
|
||||
poolChan chan *producerPool
|
||||
}
|
||||
|
||||
@@ -141,14 +142,15 @@ func (n *Writer) doLoop() {
|
||||
}
|
||||
|
||||
buf = append(buf, body)
|
||||
n.bodySize += len(body)
|
||||
if pool == nil {
|
||||
timer.Reset(500 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
if len(buf) >= maxBufSize {
|
||||
if n.bodySize >= maxBufSize {
|
||||
tmp := buf
|
||||
buf = buf[:0]
|
||||
|
||||
n.bodySize = 0
|
||||
err := pool.Publish(n.topic, tmp)
|
||||
if err != nil {
|
||||
log.Error("nsq publish error: ", err.Error())
|
||||
|
@@ -13,7 +13,9 @@ func newProxy() *_Proxy {
|
||||
}
|
||||
|
||||
func (p *_Proxy) Set(values []interface{}) {
|
||||
p.pointer.Store(&values)
|
||||
tmp := make([]interface{}, 0, len(values))
|
||||
tmp = append(tmp, values...)
|
||||
p.pointer.Store(&tmp)
|
||||
}
|
||||
|
||||
func (p *_Proxy) List() []interface{} {
|
||||
|
Reference in New Issue
Block a user