Skip to content

Commit

Permalink
Improve cache behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelZ committed Jun 7, 2022
1 parent 9a011cc commit 797eff1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Custom Sensors/EXEXML/Get-SSLReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ function Get-SSLReport {
)

# Construct the URI part for Caching
if ($MaxCacheAgeHours -eq 0)
{
if ($MaxCacheAgeHours -eq 0) {
$MaxCacheAgeHours -eq 1
$cacheString = "&startNew=on"
} elseif ($MaxCacheAgeHours -lt 0) {
$cacheString = ""
} else {
$cacheString = "&fromCache=on&maxAge=$MaxCacheAgeHours"
}
Expand Down Expand Up @@ -155,10 +157,10 @@ function Get-SSLReport {
{
"IN_PROGRESS" {
Write-Verbose "Scan is in progress. Waiting."
start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge $maxCacheAge -timeoutSec $timeoutSec }
start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge -1 -timeoutSec $timeoutSec }
"DNS" {
Write-Verbose "Scan is in progress. Waiting."
start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge $maxCacheAge -timeoutSec $timeoutSec }
start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge -1 -timeoutSec $timeoutSec }
"ERROR" {
throw $parsed.statusMessage
}
Expand Down

0 comments on commit 797eff1

Please sign in to comment.