resque-fine-grained-locks 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/resque/plugins/execution_lock.rb +5 -2
- metadata +5 -5
|
@@ -7,11 +7,14 @@ module Resque
|
|
|
7
7
|
"execution_lock:#{name}-#{args.to_s}"
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
# This method must execute AFTER before_perform_retry (defined by resque-retry)
|
|
11
|
+
# If this executes first the job will retry forever
|
|
12
|
+
# Resque executes hooks in alphabetical order
|
|
13
|
+
def before_perform_retry_execution_lock(*args)
|
|
11
14
|
raise JobIsLocked unless Resque.redis.setnx(execution_lock(*args), true)
|
|
12
15
|
end
|
|
13
16
|
|
|
14
|
-
def
|
|
17
|
+
def around_perform_retry_execution_lock(*args)
|
|
15
18
|
begin
|
|
16
19
|
yield
|
|
17
20
|
ensure
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: resque-fine-grained-locks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 21
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 1.0.
|
|
9
|
+
- 1
|
|
10
|
+
version: 1.0.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Efficiency 2.0
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-
|
|
18
|
+
date: 2012-05-16 00:00:00 Z
|
|
19
19
|
dependencies: []
|
|
20
20
|
|
|
21
21
|
description: |+
|
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
67
67
|
requirements: []
|
|
68
68
|
|
|
69
69
|
rubyforge_project:
|
|
70
|
-
rubygems_version: 1.8.
|
|
70
|
+
rubygems_version: 1.8.8
|
|
71
71
|
signing_key:
|
|
72
72
|
specification_version: 3
|
|
73
73
|
summary: Resque plugins for ensuring only one instance of your job is queued and/or executing at a time.
|