resque-workers-lock 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,13 @@
1
1
  module Resque
2
+ alias_method :orig_remove_queue, :remove_queue
3
+
4
+ def remove_queue(queue)
5
+ Resque.redis.keys('enqueuelock:*').collect { |x| Resque.redis.del(x) }.count
6
+ Resque.redis.keys('workerslock:*').collect { |x| Resque.redis.del(x) }.count
7
+
8
+ orig_remove_queue(queue)
9
+ end
10
+
2
11
  module Plugins
3
12
  module Workers
4
13
  module Lock
data/test/lock_test.rb CHANGED
@@ -64,6 +64,12 @@ class LockTest < Test::Unit::TestCase
64
64
  end
65
65
 
66
66
  assert_equal 4, Resque.redis.llen('queue:lock_test')
67
+
68
+ # Test for complete queue wipe
69
+ Resque.remove_queue(:lock_test)
70
+
71
+ Resque.enqueue(SimilarJob)
72
+ assert_equal 1, Resque.redis.llen('queue:lock_test')
67
73
  end
68
74
 
69
75
  def test_zcleanup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-workers-lock
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: