Changeset 0ad9404448f7…
Parent 0ca99d0c705a…
by Quentin Schroeder <quentin@fogcreek.com>
Changes to one file · Browse files at 0ad9404448f7 Showing diff from parent 0ca99d0c705a Diff from another changeset...
@@ -1,39 +1,62 @@ - # TODO:
-# - Add switch "reenqueueFailures" to do that (mutually exclusive with "destoryFailures")
-# - Add switch "reenqueueRunning" to do that
-# - Display usage informaiton when run with no parameters
+<#
+.SYNOPSIS
+ Reenqueues or destroys tasks in the Kiln Queue Service
+.DESCRIPTION
+ This script is similar to the old FogCreek "churn the queue" script that we had for versions of Kiln prior to
+ 2.9.x. It simply hits the URLs that are provided via the Queue Stats page to reenqueue or destrow all
+ failed tasks and/or all currently running tasks (since they can get stuck running sometimes). It should
+ be used when the page at http://localhost:56785/ indicates that the queue is choking.
-# This script will reenqueue all failed and all currently running tasks in a Kiln Queue
-#
-# Name: Reenqueue all Tasks
-# Author: Quentin Schroeder
-# Version: 1.0.0
-# Description: This script is similar to our old "churn the queue" script that we had for versions of Kiln prior to
-# 2.9.x. It simply hits the URLs that are provided via the Queue Stats page to reenqueue all failed tasks
-# as well as all currently running tasks (since they can get stuck running sometimes). It should be used
-# when the page at http://localhost:56785/ indicates that the queue is choking.
-# Requirements: PowerShell v2.0
-# Parameters: destroyFailures - A switch to destroy all failures instead of reenqueuing them.
+.EXAMPLE
+ reenqueue_2.9_tasks.ps1 -retryCurrent -destroyFailures
+ This will reset everything that is currently in the queue, and permenantly destroy all failed tasks.
+.PARAMETER qs_host
+ The machine name where the Queue Service is running. The default value is almost always correct.
-param( [string]$qs_host = "localhost", # This will almost always have to be run directly from the server
- [switch]$destroyFailures, # Add this switch parameter to destroy all failed tasks
- [switch]$retryFailures, # Add this switch parameter to reenqueue all failed tasks
- [switch]$destroyRunning, # Add this switch parameter to destroyed all currently running tasks
- [switch]$retryRunning # Add this switch parameter to reenqueue all currently running tasks
- )
+.PARAMETER destroyFailures
+ Destroys all failed tasks (mutually exclusive with '-retryFailures').
+
+.PARAMETER retryFailures
+ Retries all failed tasks (mutually exclusive with '-destroyFailures').
+
+.PARAMETER destroyRunning
+ Destroys all currently running tasks (mutually exclusive with '-retryRunning').
+
+.PARAMETER retryRunning
+ Retries all currently running tasks (mutually exclusive with '-destroyRunning').
+
+.NOTES
+ Author: Quentin Schroeder
+ Date: Dec 13, 2012
+#>
+
+
+
+param([string]$qs_host = "localhost",
+ [switch]$destroyFailures,
+ [switch]$retryFailures,
+ [switch]$destroyRunning,
+ [switch]$retryRunning
+ )
function main() {
if ($destroyFailures -and $retryFailures)
{
write-host "Cannot choose to both destroy AND retry failed tasks, please select only one option."
+ exit
}
if ($destroyRunning -and $retryRunning)
{
write-host "Cannot choose to both destroy AND retry running tasks, please select only one option."
+ exit
+ }
+ if (!($destroyRunning -or $retryRunning -or $destroyFailures -or $retryFailures))
+ {
+ write-host "`nNo command was selected, this script will only show the current counts of running and failed tasks in the Queue.`n"
}
|
Loading...