resque-workers-lock 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,7 +12,7 @@ If resque jobs have the same lock applied this means that those jobs cannot be p
12
12
  By default the lock is the instance name + arguments (just like the classic resque-lock). Override this lock to lock on specific arguments.
13
13
 
14
14
  ## How does it differ from resque-lock?
15
- Resque-lock will not let you queue jobs when you locked them. Resque-workers-lock locks on a workers-level and will requeue the locked jobs. Resque workers lock will not prevent you to queue jobs. If a worker takes on a job that is already being processed by another worker it will put the job back up in the queue! Also, this plugin will still offer you the ability to lock at enqueue-level just like resque-lock does (see example).
15
+ Resque-lock will not let you queue jobs when you locked them. Resque-workers-lock locks on a workers-level and will requeue the locked jobs. When the enqueue_lock is set to false, this plugin will not prevent you to queue jobs. If a worker takes on a job that is already being processed by another worker it will put the job back up in the queue! Also, this plugin will still offer you the ability to lock at enqueue-level just like resque-lock does (see example).
16
16
 
17
17
  ## Example
18
18
  This example shows how you can use the workers-lock to prevent two jobs with the same domain to be processed simultaneously.
@@ -29,6 +29,7 @@ module Resque
29
29
  nx = Resque.redis.setnx(workers_lock(*args), true)
30
30
  if nx == false
31
31
  sleep(requeue_perform_delay)
32
+ Resque.redis.del(enqueue_lock(*args))
32
33
  Resque.enqueue(self, *args)
33
34
  raise Resque::Job::DontPerform
34
35
  end
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.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: