skiplock 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skiplock/job.rb +3 -3
- data/lib/skiplock/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d942af62acf618cbb7d7baeaf3d2f0404aac8cf012c255c8806ddbe5d23fd9
|
4
|
+
data.tar.gz: 7383cfaf4f4a15b0cb9fe8a55bca896b72bcb3c728684aa4e60cc876be67d97e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 487fc69ce0ff35ed020c2c0d0823303743d86afd1acd9a18d2399602afcb34f15e1f8215a10f65fafdcf10f9a3982fe8c76cb2df3043dff5ee6562f2379dfd03
|
7
|
+
data.tar.gz: e71774849db02070c6690d76818f22d693dc7531d3e9ca09710a8768359bdda857edf734f0f86d386e03098d1c66991aae6c7d4b91c2398b7135dc9dc4f25980
|
data/lib/skiplock/job.rb
CHANGED
@@ -27,9 +27,9 @@ module Skiplock
|
|
27
27
|
timestamp = Time.at(timestamp) if timestamp
|
28
28
|
if Thread.current[:skiplock_job].try(:id) == activejob.job_id
|
29
29
|
Thread.current[:skiplock_job].activejob_error = options[:error]
|
30
|
-
Thread.current[:skiplock_job].data['activejob_error'] = true
|
31
30
|
Thread.current[:skiplock_job].executions = activejob.executions
|
32
31
|
Thread.current[:skiplock_job].exception_executions = activejob.exception_executions
|
32
|
+
Thread.current[:skiplock_job].exception_executions['activejob_error'] = true
|
33
33
|
Thread.current[:skiplock_job].scheduled_at = timestamp
|
34
34
|
Thread.current[:skiplock_job]
|
35
35
|
else
|
@@ -65,8 +65,8 @@ module Skiplock
|
|
65
65
|
self.worker_id = nil
|
66
66
|
self.updated_at = Time.now > self.updated_at ? Time.now : self.updated_at + 1 # in case of clock drifting
|
67
67
|
if self.exception
|
68
|
-
self.exception_executions["[#{self.exception.class.name}]"] = self.exception_executions["[#{self.exception.class.name}]"].to_i + 1 unless self.
|
69
|
-
if (self.executions.to_i >= self.max_retries + 1) || self.
|
68
|
+
self.exception_executions["[#{self.exception.class.name}]"] = self.exception_executions["[#{self.exception.class.name}]"].to_i + 1 unless self.exception_executions.key?('activejob_error')
|
69
|
+
if (self.executions.to_i >= self.max_retries + 1) || self.exception_executions.key?('activejob_error') || self.exception.is_a?(Skiplock::Extension::ProxyError)
|
70
70
|
self.expired_at = Time.now
|
71
71
|
else
|
72
72
|
self.scheduled_at = Time.now + (5 * 2**self.executions.to_i)
|
data/lib/skiplock/version.rb
CHANGED