resque-job_history 0.0.21 → 0.0.22
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/job_history.rb +4 -1
- data/lib/resque/plugins/job_history/job.rb +7 -3
- 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: 6d328ea1b14c7876088234d1c4d3640423ab2f8059006eaadbf908ca73275afa
|
4
|
+
data.tar.gz: d59d30e5ddc0d79bb6812b17f5f5236aa8cda1ea973c699ce32576718257bbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0ae0984ef34a9a40519d68cbc9e0338b414df97b52f130dec1e3c5a2e547bccdd84330f2966cd8518c4731bdba3684ce408034cadebb9b9ca96f523649d2809
|
7
|
+
data.tar.gz: da4a3ce71e67a2aaeca3784fb29accf6075aeb70b2c087d4790b3713997626aa14d9ade0a02efe1152f58a4a01901906ad701f5598a199e037076cbe4df1a267
|
@@ -65,7 +65,10 @@ module Resque
|
|
65
65
|
running_job.failed exception, start_time, *args
|
66
66
|
raise
|
67
67
|
ensure
|
68
|
-
running_job.
|
68
|
+
if running_job.present? && !running_job.finished? && !running_job.error
|
69
|
+
running_job.cancel(" Job did not signal completion on finish.", start_time, *args)
|
70
|
+
end
|
71
|
+
|
69
72
|
self.most_recent_job = nil
|
70
73
|
end
|
71
74
|
end
|
@@ -28,6 +28,10 @@ module Resque
|
|
28
28
|
stored_values[:end_time].present?
|
29
29
|
end
|
30
30
|
|
31
|
+
def blank?
|
32
|
+
!redis.exists job_key
|
33
|
+
end
|
34
|
+
|
31
35
|
def succeeded?
|
32
36
|
error.blank?
|
33
37
|
end
|
@@ -72,7 +76,7 @@ module Resque
|
|
72
76
|
record_job_start(start_time, *args)
|
73
77
|
end
|
74
78
|
|
75
|
-
if
|
79
|
+
if present?
|
76
80
|
redis.hset(job_key, "end_time", Time.now.utc.to_s)
|
77
81
|
finished_jobs.add_job(job_id, class_name)
|
78
82
|
end
|
@@ -89,7 +93,7 @@ module Resque
|
|
89
93
|
record_job_start(start_time, *args)
|
90
94
|
end
|
91
95
|
|
92
|
-
redis.hset(job_key, "error", exception_message(exception)) if
|
96
|
+
redis.hset(job_key, "error", exception_message(exception)) if present?
|
93
97
|
redis.incr(total_failed_key)
|
94
98
|
|
95
99
|
finish
|
@@ -106,7 +110,7 @@ module Resque
|
|
106
110
|
record_job_start(start_time, *args)
|
107
111
|
end
|
108
112
|
|
109
|
-
if
|
113
|
+
if present?
|
110
114
|
redis.hset(job_key,
|
111
115
|
"error",
|
112
116
|
"Unknown - Job failed to signal ending after the configured purge time or was canceled manually.#{caller_message}")
|