fix(ci): allow server transfer task in telemetry-only mode and align authz reconnect test

This commit is contained in:
Bot
2026-09-04 18:46:58 +08:00
parent 8c481985c2
commit 5d0da5490c
2 changed files with 9 additions and 7 deletions
+6 -6
View File
@@ -34,11 +34,11 @@ type Server struct {
DDNSProfiles []uint64 `gorm:"-" json:"ddns_profiles,omitempty" validate:"optional"` // DDNS配置
OverrideDDNSDomains map[uint64][]string `gorm:"-" json:"override_ddns_domains,omitempty" validate:"optional"`
Host *Host `gorm:"-" json:"host,omitempty"`
State *HostState `gorm:"-" json:"state,omitempty"`
GeoIP *GeoIP `gorm:"-" json:"geoip,omitempty"`
LastActive time.Time `gorm:"-" json:"last_active,omitempty"`
TelemetryOnly bool `json:"telemetry_only" gorm:"default:false"`
Host *Host `gorm:"-" json:"host,omitempty"`
State *HostState `gorm:"-" json:"state,omitempty"`
GeoIP *GeoIP `gorm:"-" json:"geoip,omitempty"`
LastActive time.Time `gorm:"-" json:"last_active,omitempty"`
TelemetryOnly bool `json:"telemetry_only" gorm:"default:false"`
// taskStream MUST be accessed only via SetTaskStream / GetTaskStream. Direct
// field access from outside this file races with the gRPC RequestTask
@@ -319,7 +319,7 @@ func (s *Server) IsTelemetryOnly() bool {
}
func (s *Server) SendTask(task *pb.Task) error {
if s.IsTelemetryOnly() && task != nil && !IsServiceMonitorType(task.GetType()) {
if s.IsTelemetryOnly() && task != nil && !IsServiceMonitorType(task.GetType()) && task.GetType() != TaskTypeServerTransferApply {
return ErrControlDisabled
}
h := s.taskStream.Load()
+3 -1
View File
@@ -389,7 +389,9 @@ func runApplyConfigAuthzReconnect(t *testing.T, secret, uuid string) []*pb.Task
"client_uuid", uuid,
)),
onSend: func(task *pb.Task) {
sent = append(sent, task)
if task.Type == model.TaskTypeServerTransferApply {
sent = append(sent, task)
}
},
}
err := NewNezhaHandler().RequestTask(stream)