Skip to content

Commit 968ed82

Browse files
Fix for management stats
1 parent c0457be commit 968ed82

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ function Start-CIPPStatsTimer {
4343
CFZTNA = $RawExt.CFZTNA.Enabled
4444
GitHub = $RawExt.GitHub.Enabled
4545
} | ConvertTo-Json
46-
47-
Invoke-RestMethod -Uri 'https://management.cipp.app/api/stats' -Method POST -Body $SendingObject -ContentType 'application/json'
46+
try {
47+
Invoke-RestMethod -Uri 'https://management.cipp.app/api/stats' -Method POST -Body $SendingObject -ContentType 'application/json'
48+
} catch {
49+
$rand = Get-Random -Minimum 0.5 -Maximum 5.5
50+
Start-Sleep -Seconds $rand
51+
Invoke-RestMethod -Uri 'https://management.cipp.app/api/stats' -Method POST -Body $SendingObject -ContentType 'application/json'
52+
}
4853
}
4954
}

0 commit comments

Comments
 (0)