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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 272a762705e9396cae975b8113183ae579557cf0e77412b6f4c1cb609ff0ff96
4
- data.tar.gz: c9e0df1f067302a22ee086413f9fa57ae7a56f84cef52d29c27e5dc372336112
3
+ metadata.gz: 6d328ea1b14c7876088234d1c4d3640423ab2f8059006eaadbf908ca73275afa
4
+ data.tar.gz: d59d30e5ddc0d79bb6812b17f5f5236aa8cda1ea973c699ce32576718257bbcf
5
5
  SHA512:
6
- metadata.gz: c5cb6a16f6808621408467ed6658822394c1b0eb395589dad5d41657747877b032dc17a12efea5915b8d4ea046b3d95c1af03db36d14b847a33b2b442b95dbe2
7
- data.tar.gz: df26c5d144fd44da9f331399cd57e71fc9e0972fee60d7c304a5ed5a08eb2fa6599814870f1027d4263839c16620ee222358e6d1995c4e4c1c5f311f443c2332
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.cancel(" Job did not signal completion on finish.", start_time, *args) unless running_job.finished? || running_job.error
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 redis.exists(job_key)
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 redis.exists(job_key)
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 redis.exists(job_key)
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}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-job_history
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - RealNobody