Permalink
Browse files

Fixing a problem where we raise an error when deleting an already emp…

…ty queue.
  • Loading branch information...
1 parent 53ee2b9 commit a5af08f7d71568aae2c12c343a8c1480dc0fb341 @zmoazeni zmoazeni committed Jun 17, 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 a5af08f

Please sign in to comment.