v1.5.1 增强程序稳定性
This commit is contained in:
@@ -3,6 +3,7 @@ package nodes
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeDNS/internal/accesslogs"
|
||||
"github.com/TeaOSLab/EdgeDNS/internal/goman"
|
||||
"github.com/TeaOSLab/EdgeDNS/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeDNS/internal/rpc"
|
||||
"strconv"
|
||||
@@ -24,7 +25,9 @@ func NewNSAccessLogQueue() *NSAccessLogQueue {
|
||||
queue := &NSAccessLogQueue{
|
||||
queue: make(chan *pb.NSAccessLog, maxSize),
|
||||
}
|
||||
go queue.Start()
|
||||
goman.New(func() {
|
||||
queue.Start()
|
||||
})
|
||||
|
||||
return queue
|
||||
}
|
||||
@@ -93,10 +96,11 @@ Loop:
|
||||
var clusterId int64
|
||||
var needWriteFile = true
|
||||
var needReportAPI = true
|
||||
if sharedNodeConfig != nil {
|
||||
clusterId = sharedNodeConfig.ClusterId
|
||||
if sharedNodeConfig.AccessLogWriteTargets != nil {
|
||||
targets := sharedNodeConfig.AccessLogWriteTargets
|
||||
var cfg = dnsNodeConfig()
|
||||
if cfg != nil {
|
||||
clusterId = cfg.ClusterId
|
||||
if cfg.AccessLogWriteTargets != nil {
|
||||
targets := cfg.AccessLogWriteTargets
|
||||
needWriteFile = targets.File || targets.ClickHouse
|
||||
needReportAPI = targets.MySQL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user