resque-workers-lock 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/plugins/workers/lock.rb +13 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a240599f0ecc2716892ae8eb45e7abe12f2687b8
|
4
|
+
data.tar.gz: 37ba38c9cb774ebf4fc293813800a99ac257d3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 005617d1f3650acf154d8c355a48d53c70906d61fad31cefbffb18adaaab7ba01497c55a57c674189ff38f2f95a42eac7c0d0671339ba7a7d9c9a5f1127c4d41
|
7
|
+
data.tar.gz: 7c188eea29e6543b9eed0f1774bac4de11cecb5338e1d25e03b6bad927a976c3bccc148cfcff69fbdbeb8c0e7dbb1c9338a63d96f4f7f83ab2c9c8bf967fd83d
|
@@ -41,6 +41,18 @@ module Resque
|
|
41
41
|
1.0
|
42
42
|
end
|
43
43
|
|
44
|
+
# Override in your job to change the way how job is reenqueued
|
45
|
+
def reenqueue(*args)
|
46
|
+
if defined? Resque::Scheduler
|
47
|
+
# schedule a job in requeue_perform_delay seconds
|
48
|
+
Resque.enqueue_in(requeue_perform_delay, self, *args)
|
49
|
+
else
|
50
|
+
sleep(requeue_perform_delay)
|
51
|
+
Resque.enqueue(self, *args)
|
52
|
+
end
|
53
|
+
raise Resque::Job::DontPerform
|
54
|
+
end
|
55
|
+
|
44
56
|
# Called with the job args before perform.
|
45
57
|
# If it raises Resque::Job::DontPerform, the job is aborted.
|
46
58
|
def before_perform_workers_lock(*args)
|
@@ -52,9 +64,7 @@ module Resque
|
|
52
64
|
Resque.redis.expire(lock, worker_lock_timeout(*args))
|
53
65
|
end
|
54
66
|
else
|
55
|
-
|
56
|
-
Resque.enqueue(self, *args)
|
57
|
-
raise Resque::Job::DontPerform
|
67
|
+
reenqueue(*args)
|
58
68
|
end
|
59
69
|
end
|
60
70
|
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-workers-lock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bart Olsthoorn
|
8
8
|
- Mike Nicholaides
|
9
9
|
- Jason Garber
|
10
10
|
- Tijs Planckaert
|
11
|
+
- Anton Bogdanovich
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date:
|
15
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: resque
|
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
80
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.4.6
|
81
82
|
signing_key:
|
82
83
|
specification_version: 4
|
83
84
|
summary: Resque plugin, prevent specific jobs to be processed simultaneously by multiple
|