Changeset a003225a0599…
Parent f2974d8da963…
by Quentin Schroeder <quentin@fogcreek.com>
Changes to one file · Browse files at a003225a0599 Showing diff from parent f2974d8da963 Diff from another changeset...
|
@@ -83,50 +83,19 @@
-param([Parameter(ParameterSetName="noemail")]
- [string]$kilnURL = "http://localhost/fogbugz/kiln",
-
- [Parameter(ParameterSetName="email", Mandatory=$true)]
+param([string]$kilnURL = "http://localhost/fogbugz/kiln",
[string]$smtpServer = "",
-
- [Parameter(ParameterSetName="email", Mandatory=$true)]
- [Parameter(ParameterSetName="noemail")]
[string]$from = "",
-
- [Parameter(ParameterSetName="email", Mandatory=$true)]
- [Parameter(ParameterSetName="noemail")]
[string]$to = "",
-
- [Parameter(ParameterSetName="email", Mandatory=$true)]
- [Parameter(ParameterSetName="noemail")]
[string]$username = "",
-
- [Parameter(ParameterSetName="email", Mandatory=$true)]
- [Parameter(ParameterSetName="noemail")]
[string]$password = "",
-
- [Parameter(ParameterSetName="email")]
[switch]$smtpSsl,
-
- [Parameter(ParameterSetName="email")]
[string]$smtpPort = 587,
-
- [Parameter(ParameterSetName="noemail")]
[string]$backendVersionUrl = "http://localhost:56783/version",
-
- [Parameter(ParameterSetName="noemail")]
[string]$esUrl = "http://localhost:9200/",
-
- [Parameter(ParameterSetName="noemail")]
[string]$queueStatsUrl = "http://localhost:56785/stats.json",
-
- [Parameter(ParameterSetName="noemail")]
[string]$iisSiteName = "",
-
- [Parameter(ParameterSetName="noemail")]
[switch]$noRestart,
-
- [Parameter(ParameterSetName="noemail")]
[string]$reenqueuePath = ".\reenqueue_2.9_tasks.ps1"
)
@@ -165,9 +134,10 @@ Write-WithTime " Unable to send email, an error occurred.`n$exceptionMessage" $true
}
}
- elseif ($smtpServer -or $from -or $to -or $username -or $password -or $smtpSsl)
+ elseif ($smtpServer -or $from -or $to -or $username -or $password -or $smtpSsl -or ($smtpPort -ne 587))
{
- Write-WithTime " Unable to send email, some required parameters are missing!" $true
+ Write-WithTime " Unable to send email, some required parameters are missing! Writing to std-out." $true
+ Write-WithTime " $msg" $true
}
else
{
@@ -227,7 +197,7 @@ {
$exceptionMessage = $_.Exception.Message
Handle-Error("Critical Kiln Server error. Could not reach URL [$url]`n$exceptionMessage")
- $serviceNeedsRestart = $true
+ $serviceNeedsRestart.value = $true
}
}
@@ -249,15 +219,15 @@
Write-WithTime ""
Write-WithTime "--Queue Stats Information--"
- Write-WithTime " Time reported: $timeDiff seconds from now"
+ Write-WithTime " Time Accuracy: within $timeDiff seconds"
Write-WithTime " Queue Length: $queueLength"
Write-WithTime " Running Task Count: $runningTaskCount"
Write-WithTime " Age of oldest task: $oldestTaskAge seconds"
- if (($timeDiff -gt 5) -or ($timeDiff -lt 5))
+ if (($timeDiff -gt 5) -or ($timeDiff -lt -5))
{
- $serviceNeedsRestart = $true
+ $serviceNeedsRestart.value = $true
}
@@ -295,7 +265,7 @@ {
$exceptionMessage = $_.Exception.Message
Handle-Error("Error obtaining or processing Kiln Queue Stats`n$exceptionMessage")
- $serviceNeedsRestart = $true
+ $serviceNeedsRestart.value = $true
}
}
|
Loading...