delayed_job_extras 0.9.8 → 0.9.9
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.
- data/lib/delayed_job_extras/hoptoad.rb +14 -15
- metadata +2 -2
@@ -1,27 +1,26 @@
|
|
1
1
|
begin
|
2
|
-
|
3
|
-
# let's use it so we can get some good notifications
|
4
|
-
# when an exception is raised.
|
5
|
-
require 'hoptoad_notifier'
|
6
|
-
|
2
|
+
|
7
3
|
DJ::Worker.logger.info "Adding Hoptoad support to Delayed::Job"
|
8
4
|
|
9
5
|
module Delayed
|
10
6
|
class Job
|
11
|
-
include HoptoadNotifier::Catcher
|
12
7
|
|
13
8
|
def invoke_job_with_hoptoad
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
9
|
+
if defined?(HoptoadNotifier)
|
10
|
+
Delayed::Job.send(:define_method, :invoke_job_with_hoptoad) do
|
11
|
+
begin
|
12
|
+
invoke_job_without_hoptoad
|
13
|
+
rescue Exception => e
|
14
|
+
HoptoadNotifier.notify(e, :cgi_data => self.attributes)
|
15
|
+
raise e
|
16
|
+
end
|
17
|
+
end
|
18
|
+
else
|
19
|
+
Delayed::Job.send(:define_method, :invoke_job_with_hoptoad) do
|
20
|
+
invoke_job_without_hoptoad
|
21
21
|
end
|
22
|
-
notify_hoptoad(h)
|
23
|
-
raise e
|
24
22
|
end
|
23
|
+
invoke_job_with_hoptoad
|
25
24
|
end
|
26
25
|
|
27
26
|
alias_method_chain :invoke_job, :hoptoad
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-10 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|