resque-unique_at_runtime 2.0.2 → 2.0.3
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.
- checksums.yaml +4 -4
- data/lib/resque-unique_at_runtime.rb +5 -2
- data/lib/resque-unique_at_runtime/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 220f16a02747d08f43f10ea29af60c822326c843
|
|
4
|
+
data.tar.gz: 648b278859a21ce7c2003be5118a3dbd515a9e8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d629acacf989b15e31abc4de4f4428bdd68098b7965859415086f7c64d90454e4e72ff1c47ce6ea31330a8fedafd6fbf97ea9fba9a026dd95b43e791b0e7a1e3
|
|
7
|
+
data.tar.gz: 51d6785a56a77a574d71bf3fe2c8a8d05cd843c98a638fbb494a9fd31327cb406030ceee3277e92aa07f1cc0db1cbf5ca1e08f963dd2fe0db5ccece0e59068a5
|
|
@@ -3,16 +3,19 @@ require 'resque-unique_at_runtime/version'
|
|
|
3
3
|
module Resque
|
|
4
4
|
module Plugins
|
|
5
5
|
module UniqueAtRuntime
|
|
6
|
+
LOCK_TIMEOUT = 60 * 60 * 24 * 5
|
|
7
|
+
REQUEUE_INTERVAL = 1
|
|
8
|
+
|
|
6
9
|
def runtime_lock_timeout_at(now)
|
|
7
10
|
now + runtime_lock_timeout + 1
|
|
8
11
|
end
|
|
9
12
|
|
|
10
13
|
def runtime_lock_timeout
|
|
11
|
-
self.instance_variable_get(:@runtime_lock_timeout) ||
|
|
14
|
+
self.instance_variable_get(:@runtime_lock_timeout) || LOCK_TIMEOUT
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
def runtime_requeue_interval
|
|
15
|
-
self.instance_variable_get(:@runtime_requeue_interval) ||
|
|
18
|
+
self.instance_variable_get(:@runtime_requeue_interval) || REQUEUE_INTERVAL
|
|
16
19
|
end
|
|
17
20
|
|
|
18
21
|
# Overwrite this method to uniquely identify which mutex should be used
|