resque-job_history 0.0.8 → 0.0.9
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 +12 -15
- data/lib/resque/plugins/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: a1bcddf23e0810a21b31ff619ee1c7a5c5f11974
|
4
|
+
data.tar.gz: 2dff8784d8d962f84b3ce2c9cc197ca52f6fad9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bd5e7b212eef1755b55b2e2d069727fd79634c5356eca014b451dbf06f525e4280aa5ddd96ee32b63c47a17db68227bb09829560c17d19861476f79198c8093
|
7
|
+
data.tar.gz: d8c0b165e02196b451a9bf5066376841670a96300aaff547cb796eb1de8b95cee1f71b083d2a8f9d2920896a569003ae3d74efadb12cb1871717339172c37b0c
|
@@ -38,24 +38,21 @@ module Resque
|
|
38
38
|
# The class methods added to the job class that is being enqueued and whose history is to be
|
39
39
|
# recorded.
|
40
40
|
module ClassMethods
|
41
|
-
|
41
|
+
def around_perform_job_history(*args)
|
42
|
+
running_job = Resque::Plugins::JobHistory::Job.new(name, SecureRandom.uuid)
|
42
43
|
|
43
|
-
|
44
|
-
|
44
|
+
begin
|
45
|
+
running_job.start(*args)
|
45
46
|
|
46
|
-
|
47
|
+
yield if block_given?
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
def on_failure_job_history(exception, *_args)
|
57
|
-
running_job.try(:failed, exception)
|
58
|
-
@running_job = nil
|
49
|
+
running_job.finish
|
50
|
+
rescue StandardError => exception
|
51
|
+
running_job.failed exception
|
52
|
+
raise
|
53
|
+
ensure
|
54
|
+
running_job.cancel unless running_job.finished? || running_job.error
|
55
|
+
end
|
59
56
|
end
|
60
57
|
|
61
58
|
def job_history_len
|