diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-14 13:34:19 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-14 13:34:19 +0000 |
commit | 2e78eb9a609f9d9fc697fde01a48c58a431e0445 (patch) | |
tree | 9e306024ba97ea4e8319e092c35e9c80bc3f39b7 /bin/custodian-dequeue | |
parent | 3e5addf135c2c23bb174e2d2e46ed1ac6f555cdf (diff) |
Removed the flushing-action from custodian-dequeue and added it to the
new helper tool
Diffstat (limited to 'bin/custodian-dequeue')
-rwxr-xr-x | bin/custodian-dequeue | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/bin/custodian-dequeue b/bin/custodian-dequeue index a02a75c..49ed052 100755 --- a/bin/custodian-dequeue +++ b/bin/custodian-dequeue @@ -6,7 +6,6 @@ # SYNOPSIS # custodian-dequeue [ -h | --help ] # [ -m | --manual] -# [ -f | --flush ] # [ -l | --logfile FILE] # [ -S | --server 1.2.3.4:123 ] # [ -s | --single ] @@ -18,8 +17,6 @@ # # -m, --manual Show this manual, and exit. # -# -f, --flush Flush the queue, removing all jobs. -# # -l, --logfile Specify the path to the logfile to run. # # -S, --server Specify the host:port for the beanstalkd queue. @@ -199,26 +196,6 @@ class Custodian puts msg if ( ENV['VERBOSE'] ) end - # - # Flush the queue. - # - def flush_queue! - - log_message( "Flushing queue" ) - - while( true ) - begin - job = @queue.reserve(1) - id = job.id - log_message( "Deleted job #{id}" ) - job.delete - rescue Beanstalk::TimedOut => ex - log_message( "The queue is now empty" ) - return - end - end - end - # @@ -366,7 +343,6 @@ if __FILE__ == $0 then begin opts = GetoptLong.new( - [ "--flush", "-f", GetoptLong::NO_ARGUMENT ], [ "--help", "-h", GetoptLong::NO_ARGUMENT ], [ "--manual", "-m", GetoptLong::NO_ARGUMENT ], [ "--logfile", "-l", GetoptLong::REQUIRED_ARGUMENT ], @@ -379,8 +355,6 @@ if __FILE__ == $0 then case opt when "--verbose": ENV["VERBOSE"] = "1" - when "--flush": - ENV["FLUSH"] = "1" when "--logfile": $LOGFILE = arg when "--repeat": @@ -436,13 +410,6 @@ if __FILE__ == $0 then # worker = Custodian.new( $SERVER, $LOGFILE ) - # - # Are we flushing the queue? - # - if ( ENV['FLUSH'] ) - worker.flush_queue! - exit(0) - end # # Single step? |