Skip to content

Commit

Permalink
nacos输出报错信息
Browse files Browse the repository at this point in the history
  • Loading branch information
Dot-Liu committed Dec 15, 2023
1 parent 475bb54 commit f79234d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/discovery/nacos/nacos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions drivers/output/nsq/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
maxBufSize = 32
maxBufSize = 4 * 1024 * 1024 // 4M
)

type Writer struct {
Expand All @@ -26,6 +26,7 @@ type Writer struct {
//multiBodySize int64
//multiBodies []multiBody
bodyChan chan []byte
bodySize int
poolChan chan *producerPool
}

Expand Down Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion scope-manager/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{} {
Expand Down

0 comments on commit f79234d

Please sign in to comment.