From eaa6fd78cc6fd2eacd2d551e7eded0e899458258 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 5 Feb 2015 10:28:39 +0000 Subject: Simplify the flushing of queues. Now that we've moved to using redis by default the handling of queue-flushing needs to change. We can simply get rid of the busy-wait and run a redis "del" operation. With that in mind we've moved the flushing logic to our queue abstraction layer, and simplified our queue-helper script. --- bin/custodian-queue | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/custodian-queue b/bin/custodian-queue index 01fb381..978cbda 100755 --- a/bin/custodian-queue +++ b/bin/custodian-queue @@ -159,18 +159,7 @@ if __FILE__ == $0 then # Are we flushing the queue? # if ( $FLUSH ) - count = 0 - run = true - while( run ) - begin - job = queue.fetch(1) - exit(0) if ( job.nil? ) - count += 1 - rescue Beanstalk::TimedOut => ex - puts "Flushed #{count} pending jobs." - exit( 0 ) - end - end + queue.flush! end -- cgit v1.2.1