Update TGBeta.ps1

This commit is contained in:
2025-01-07 00:53:52 -05:00
parent d2b45940c9
commit 0703410261

View File

@@ -1036,9 +1036,10 @@ try {
Write-LogHybrid -Message "Unknown task: $TaskName" -Level "Warning" Write-LogHybrid -Message "Unknown task: $TaskName" -Level "Warning"
} }
} }
} }
function Execute-PrioritizedTasks {
function Execute-PrioritizedTasks {
param ( param (
[Parameter(Mandatory = $true)] [Parameter(Mandatory = $true)]
[array]$Tasks [array]$Tasks
@@ -1053,10 +1054,10 @@ try {
} }
Write-Output "All tasks completed." Write-Output "All tasks completed."
} }
# Route to handle incoming task execution request # Route to handle incoming task execution request
if ($request.HttpMethod -eq "POST" -and $request.Url.AbsolutePath -eq "/executeTasks") { if ($request.HttpMethod -eq "POST" -and $request.Url.AbsolutePath -eq "/executeTasks") {
try { try {
$body = Get-Content -Raw -Path $request.InputStream | ConvertFrom-Json $body = Get-Content -Raw -Path $request.InputStream | ConvertFrom-Json
$Tasks = $body.tasks $Tasks = $body.tasks
@@ -1074,7 +1075,7 @@ try {
$response.ContentLength64 = $buffer.Length $response.ContentLength64 = $buffer.Length
$response.OutputStream.Write($buffer, 0, $buffer.Length) $response.OutputStream.Write($buffer, 0, $buffer.Length)
$response.OutputStream.Close() $response.OutputStream.Close()
} }
# ---------------------------------------------------------------- # ----------------------------------------------------------------