rabbit_jobs 0.8.12 → 0.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rabbit_jobs/consumer/job_consumer.rb +18 -4
- data/lib/rabbit_jobs/job.rb +1 -0
- data/lib/rabbit_jobs/version.rb +1 -1
- data/lib/rabbit_jobs.rb +0 -1
- data/rabbit_jobs.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30070350000176518b8d5fbd7a21218f53435401
|
4
|
+
data.tar.gz: aa41a3e52db8ac1884725ab38f43a9c581ff3aac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26dca9eed2630d1242097a8df69ae8b7b0eda657ee9649bd9cc57a4bd22749e5ea6eead34c255a64ca1f832f4f54e848983c24880aa645e59ea38ac3ac784d65
|
7
|
+
data.tar.gz: 519e1e0481fec96b00543365ad6446ddbb8c82bcaa875bc0ef398892da54d7b4035de63eae24695189f66fb55c78b077bf50e951cc616dda012d8b666ec0da74
|
@@ -19,8 +19,23 @@ module RabbitJobs
|
|
19
19
|
true
|
20
20
|
end
|
21
21
|
|
22
|
-
def log_error(
|
23
|
-
|
22
|
+
def log_error(msg_or_exception, payload = nil)
|
23
|
+
if msg_or_exception.is_a?(String)
|
24
|
+
RJ.logger.error msg_or_exception
|
25
|
+
else
|
26
|
+
RJ.logger.error msg_or_exception.message
|
27
|
+
RJ.logger.error _cleanup_backtrace(msg_or_exception.backtrace).join("\n")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def log_airbrake(msg_or_exception, payload)
|
32
|
+
if defined?(Airbrake)
|
33
|
+
if msg_or_exception.is_a?(String)
|
34
|
+
Airbrake.notify(RuntimeError.new(msg_or_exception))
|
35
|
+
else
|
36
|
+
Airbrake.notify(msg_or_exception)
|
37
|
+
end
|
38
|
+
end
|
24
39
|
end
|
25
40
|
|
26
41
|
def report_error(error_type, *args)
|
@@ -33,8 +48,7 @@ module RabbitJobs
|
|
33
48
|
when :error
|
34
49
|
ex, payload = args
|
35
50
|
log_error "Cannot initialize job."
|
36
|
-
log_error ex
|
37
|
-
log_error _cleanup_backtrace(ex.backtrace).join("\n")
|
51
|
+
log_error ex, payload
|
38
52
|
log_error "Data received: #{payload.inspect}"
|
39
53
|
end
|
40
54
|
end
|
data/lib/rabbit_jobs/job.rb
CHANGED
@@ -98,6 +98,7 @@ module RabbitJobs
|
|
98
98
|
RabbitJobs.logger.warn error.message
|
99
99
|
RabbitJobs.logger.warn(self.to_ruby_string)
|
100
100
|
RabbitJobs.logger.warn _cleanup_backtrace(error.backtrace).join("\n")
|
101
|
+
Airbrake.notify(error, session: {args: self.to_ruby_string}) if defined?(Airbrake)
|
101
102
|
RabbitJobs::ErrorMailer.report_error(self, error) rescue nil
|
102
103
|
end
|
103
104
|
end
|
data/lib/rabbit_jobs/version.rb
CHANGED
data/lib/rabbit_jobs.rb
CHANGED
data/rabbit_jobs.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
gem.version = RabbitJobs::VERSION
|
18
18
|
|
19
|
-
gem.add_dependency "bunny", "0.9.0.
|
19
|
+
gem.add_dependency "bunny", "0.9.0.pre12"
|
20
20
|
gem.add_dependency "rake"
|
21
21
|
gem.add_dependency "rufus-scheduler", "~> 2.0"
|
22
22
|
gem.add_dependency "rails", "~> 3.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Lazureykis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.0.
|
19
|
+
version: 0.9.0.pre12
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.0.
|
26
|
+
version: 0.9.0.pre12
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|