Skip to content

Commit f74166c

Browse files
processor node check
1 parent 2290774 commit f74166c

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/Timer Functions/Start-CIPPProcessorQueue.ps1

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,29 @@ function Start-CIPPProcessorQueue {
2424
}
2525
if (Get-Command -Name $FunctionName -ErrorAction SilentlyContinue) {
2626
try {
27-
Invoke-Command -ScriptBlock { & $FunctionName @Parameters }
27+
# Prepare telemetry metadata
28+
$metadata = @{
29+
FunctionName = $FunctionName
30+
TriggerType = 'ProcessorQueue'
31+
QueueRowKey = $QueueItem.RowKey
32+
}
33+
34+
# Add parameters info if available
35+
if ($Parameters.Count -gt 0) {
36+
$metadata['ParameterCount'] = $Parameters.Count
37+
# Add common parameters
38+
if ($Parameters.Tenant) {
39+
$metadata['Tenant'] = $Parameters.Tenant
40+
}
41+
if ($Parameters.TenantFilter) {
42+
$metadata['Tenant'] = $Parameters.TenantFilter
43+
}
44+
}
45+
46+
# Wrap function execution with telemetry
47+
Measure-CippTask -TaskName $FunctionName -Metadata $metadata -Script {
48+
Invoke-Command -ScriptBlock { & $FunctionName @Parameters }
49+
}
2850
} catch {
2951
Write-Warning "Failed to run function $($FunctionName). Error: $($_.Exception.Message)"
3052
}

0 commit comments

Comments
 (0)