功能修改

This commit is contained in:
npc0-hue
2026-07-20 16:42:33 +08:00
parent 48b8ad8d6c
commit a0e69417db
224 changed files with 22015 additions and 884 deletions
+6 -1
View File
@@ -60,12 +60,17 @@ func ValidateRunControlHeartbeat(heartbeat domain.RunControlHeartbeat) error {
}
func appendCapacityViolations(violations []string, capacity domain.RunCapacity) []string {
if capacity.MaxJobs < 0 || capacity.RunningJobs < 0 || capacity.QueuedJobs < 0 {
if capacity.MaxJobs < 0 || capacity.RunningJobs < 0 || capacity.QueuedJobs < 0 || capacity.LogBacklogBatches < 0 || capacity.ArtifactBacklogChunks < 0 {
violations = append(violations, "capacity counts must not be negative")
}
if capacity.MaxJobs > 0 && capacity.RunningJobs > capacity.MaxJobs {
violations = append(violations, "runningJobs must not exceed maxJobs")
}
for i, code := range capacity.PressureCodes {
if strings.TrimSpace(code) == "" || strings.ContainsAny(code, " \t\r\n") || containsUnsafeRuntimeSecret(code) || looksLikeRawHostPath(code) {
violations = append(violations, fmt.Sprintf("pressureCodes[%d] is invalid", i))
}
}
return violations
}