Farm-Schlange: Rang = kleinerer aus Feld prio (auch 0) und Rang der Sitzung
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,9 @@ function Baum([int]$wurzel) { # PID und alle Nachfahren
|
||||
function Wartend { # Auftragsdateien nach (Rang, Eingang)
|
||||
$rang = @{}; if (Test-Path "$S\PRIO.txt") { gc "$S\PRIO.txt" | % { if ($_ -match '^\s*([\w-]+)\s*=\s*(\d+)') { $rang[$Matches[1]] = [int]$Matches[2] } } }
|
||||
@(Get-ChildItem "$S\auftraege\*.json" -EA 0 | % {
|
||||
$r = 50; try { $j = Get-Content $_.FullName -Raw -Encoding UTF8 | ConvertFrom-Json; if ($j.prio) { $r = [int]$j.prio } elseif ($rang.ContainsKey("$($j.sitzung)")) { $r = $rang["$($j.sitzung)"] } } catch {}
|
||||
$r = 50; try { $j = Get-Content $_.FullName -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||
if ($null -ne $j.prio) { $r = [int]$j.prio }
|
||||
if ($rang.ContainsKey("$($j.sitzung)")) { $r = [math]::Min($r, $rang["$($j.sitzung)"]) } } catch {} # der kleinere Rang gilt
|
||||
$_ | Add-Member -NotePropertyName Rang -NotePropertyValue $r -PassThru -Force } | Sort-Object Rang, LastWriteTime)
|
||||
}
|
||||
$laufend = @{} # id -> @{ p = Process; faeden; ram; start; auftrag }
|
||||
|
||||
Reference in New Issue
Block a user