Kiln » KilnSupportScripts Powershell Scripts to help monitor a Kiln environment. Contact Fog Creek support before using.
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Parameters for Reenqueue script for all option combinations (retry|destroy)(failures|running)

Changeset 0ad9404448f7

Parent 0ca99d0c705a

by Profile picture of User 1563Quentin Schroeder <quentin@fogcreek.com>

Changes to one file · Browse files at 0ad9404448f7 Showing diff from parent 0ca99d0c705a Diff from another changeset...

 
1
2
3
4
 
 
 
5
 
 
 
 
 
6
7
8
9
10
11
12
13
14
15
16
17
 
 
 
18
 
 
19
20
21
22
23
24
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
27
28
29
30
31
 
32
33
34
35
36
 
 
 
 
 
37
38
39
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
11
12
13
14
15
16
17
 
 
 
 
 
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@@ -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"   }