Permalink
Browse files

Merge pull request #9 from zmoazeni/master

FIxing an error when deleting queues
  • Loading branch information...
2 parents 53ee2b9 + a5af08f commit 3fd3cb55834bfcef2a002f4d98c87fd69f446203 @jayniz jayniz committed Jul 15, 2011
Showing with 6 additions and 1 deletion.
  1. +2 −1 lib/resque-loner/helpers.rb
  2. +4 −0 spec/loner_spec.rb
@@ -51,7 +51,8 @@ def self.job_destroy(queue, klass, *args)
end
def self.cleanup_loners(queue)
- redis.del(*redis.keys("loners:queue:#{queue}:job:*"))
+ keys = redis.keys("loners:queue:#{queue}:job:*")
+ redis.del(*keys) unless keys.empty?
end
end
View
@@ -135,6 +135,10 @@ def self.perform(foo); end
Resque.enqueue(SomeUniqueJob, "foo")
Resque.size(:other_queue).should == 1
end
+
+ it 'should not raise an error when deleting an already empty queue' do
+ expect { Resque.remove_queue(:other_queue) }.to_not raise_error
+ end
end

0 comments on commit 3fd3cb5

Please sign in to comment.