Skip to content

Commit 5a83257

Browse files
authored
Merge pull request #42 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents bf1733e + 4c4d308 commit 5a83257

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-CIPPOrchestrator.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ function Start-CIPPOrchestrator {
3333

3434
[switch]$CallerIsQueueTrigger
3535
)
36+
37+
# ─── CIPPNG runtime: push batch directly to OrchestratorService ───
38+
if ($env:CIPPNG -eq 'true' -and $InputObject) {
39+
$OrchestratorName = $InputObject.OrchestratorName ?? 'UnnamedOrchestrator'
40+
$BatchJson = ConvertTo-Json -InputObject @($InputObject.Batch) -Depth 10 -Compress
41+
42+
$PostExecFunctionName = $null
43+
$PostExecParametersJson = $null
44+
if ($InputObject.PostExecution) {
45+
$PostExecFunctionName = $InputObject.PostExecution.FunctionName
46+
if ($InputObject.PostExecution.Parameters) {
47+
$PostExecParametersJson = $InputObject.PostExecution.Parameters | ConvertTo-Json -Depth 10 -Compress
48+
}
49+
}
50+
51+
Write-Information "CIPP-NG: Queuing orchestrator '$OrchestratorName' ($($InputObject.Batch.Count) tasks$(if ($PostExecFunctionName) { ", PostExec: $PostExecFunctionName" }))"
52+
[CIPPASP.Services.OrchestratorBridge]::QueueOrchestration(
53+
$OrchestratorName,
54+
$BatchJson,
55+
4,
56+
$PostExecFunctionName,
57+
$PostExecParametersJson
58+
)
59+
return "CIPPNG-$OrchestratorName"
60+
}
61+
3662
$OrchestratorTable = Get-CippTable -TableName 'CippOrchestratorInput'
3763
$BatchTable = Get-CippTable -TableName 'CippOrchestratorBatch'
3864

Modules/CIPPCore/Public/GraphHelper/Add-CippQueueMessage.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ function Add-CippQueueMessage {
2929
}
3030

3131
try {
32+
if ($env:CIPPNG -eq 'true') {
33+
$ParametersJson = $Parameters | ConvertTo-Json -Depth 10 -Compress
34+
[CIPPASP.Services.QueueBridge]::Enqueue($Cmdlet, $ParametersJson)
35+
Write-Information "CIPP-NG: Queued $Cmdlet for background execution"
36+
return $true
37+
}
38+
3239
Push-OutputBinding -Name QueueItem -Value $QueueMessage
3340
Write-Information "Queued $Cmdlet for execution"
3441
return $true

Modules/CIPPCore/lib/Cronos.dll

52.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)