v1.5.1 增强程序稳定性

This commit is contained in:
robin
2026-03-22 17:37:40 +08:00
parent afbaaa869c
commit 17e182b413
652 changed files with 22949 additions and 34397 deletions

View File

@@ -16,8 +16,8 @@ func toPBCluster(cluster *models.HTTPDNSCluster) *pb.HTTPDNSCluster {
}
return &pb.HTTPDNSCluster{
Id: int64(cluster.Id),
IsOn: cluster.IsOn,
IsDefault: cluster.IsDefault,
IsOn: cluster.IsOn > 0,
IsDefault: cluster.IsDefault > 0,
Name: cluster.Name,
ServiceDomain: cluster.ServiceDomain,
DefaultTTL: cluster.DefaultTTL,
@@ -26,8 +26,8 @@ func toPBCluster(cluster *models.HTTPDNSCluster) *pb.HTTPDNSCluster {
TlsPolicyJSON: cluster.TLSPolicy,
CreatedAt: int64(cluster.CreatedAt),
UpdatedAt: int64(cluster.UpdatedAt),
AutoRemoteStart: cluster.AutoRemoteStart,
AccessLogIsOn: cluster.AccessLogIsOn,
AutoRemoteStart: cluster.AutoRemoteStart > 0,
AccessLogIsOn: cluster.AccessLogIsOn > 0,
TimeZone: cluster.TimeZone,
}
}

View File

@@ -127,7 +127,7 @@ func readHTTPDNSDefaultClusterIdList(tx *dbs.Tx) ([]int64, error) {
if err != nil {
return nil, err
}
if cluster != nil && cluster.IsOn {
if cluster != nil && cluster.IsOn > 0 {
validIds = append(validIds, id)
}
}

View File

@@ -120,8 +120,8 @@ func (this *HTTPDNSClusterService) FindHTTPDNSCluster(ctx context.Context, req *
}
if cluster != nil {
_ = grpc.SetHeader(ctx, metadata.Pairs(
"x-httpdns-auto-remote-start", fmt.Sprintf("%t", cluster.AutoRemoteStart),
"x-httpdns-access-log-is-on", fmt.Sprintf("%t", cluster.AccessLogIsOn),
"x-httpdns-auto-remote-start", fmt.Sprintf("%t", cluster.AutoRemoteStart > 0),
"x-httpdns-access-log-is-on", fmt.Sprintf("%t", cluster.AccessLogIsOn > 0),
"x-httpdns-time-zone", cluster.TimeZone,
))
}