File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,11 @@ function Get-CIPPTimerFunctions {
1010
1111 # Check running nodes
1212 $VersionTable = Get-CIPPTable - tablename ' Version'
13- $Nodes = Get-CIPPAzDataTableEntity @VersionTable - Filter " PartitionKey eq 'Version' and RowKey ne 'Version'" | Where-Object { $_ .RowKey -match ' - ' }
14- $AvailableNodes = $Nodes .RowKey | ForEach-Object { ( $_ -split ' - ' )[ 1 ] }
13+ $Nodes = Get-CIPPAzDataTableEntity @VersionTable - Filter " PartitionKey eq 'Version' and RowKey ne 'Version'"
14+
1515 $FunctionName = $env: WEBSITE_SITE_NAME
16+ $MainFunctionVersion = ($Nodes | Where-Object { $_.RowKey -eq $FunctionName }).Version
17+ $AvailableNodes = $Nodes.RowKey | Where-Object { $_.RowKey -match ' -' -and $_.Version -eq $MainFunctionVersion } | ForEach-Object { ($_ -split ' -' )[1 ] }
1618
1719 # Get node name
1820 if ($FunctionName -match ' -' ) {
@@ -22,7 +24,7 @@ function Get-CIPPTimerFunctions {
2224 }
2325
2426 $RunOnProcessor = $true
25- if ($Config -and $Config.state -eq $true ) {
27+ if ($Config -and $Config.state -eq $true -and $AvailableNodes .Count -gt 0 ) {
2628 if ($env: CIPP_PROCESSOR -ne ' true' ) {
2729 $RunOnProcessor = $false
2830 }
You can’t perform that action at this time.
0 commit comments