rabbit_jobs 0.8.17 → 0.8.18
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/error_mailer.rb +1 -1
- data/lib/rabbit_jobs/job.rb +8 -8
- data/lib/rabbit_jobs/publisher.rb +1 -2
- data/lib/rabbit_jobs/scheduler.rb +1 -1
- data/lib/rabbit_jobs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d5ca99e16512c61f2efa193f64312952483e7c1
|
4
|
+
data.tar.gz: 2f15f4ce6e91d24ff4697766c4ca964dbac0b10d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17ed6f485e1d30333f119810b4f002c0d17729dff04463db73505a6718191db5e88b9b85c7dd3beb72dea73d5683a75bef080ca24da7450c254c575aca57530
|
7
|
+
data.tar.gz: def105487f4cf08d99da3716a59765c424694c39fae62a8c86bb48968e1ff31a1a8e45a89618fbbaacecce66edd166ead2f4d4ddde427623ce2c30cf6ba19fa5
|
data/lib/rabbit_jobs/job.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
require 'benchmark'
|
3
|
+
|
2
4
|
module RabbitJobs
|
3
5
|
module Job
|
4
6
|
include RabbitJobs::Helpers
|
@@ -16,11 +18,9 @@ module RabbitJobs
|
|
16
18
|
|
17
19
|
def run_perform
|
18
20
|
begin
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
execution_time = Time.now - start_time
|
23
|
-
RabbitJobs.logger.info " Job completed #{self.to_ruby_string} in #{execution_time} seconds."
|
21
|
+
ret = nil
|
22
|
+
execution_time = Benchmark.measure { ret = perform(*params) }
|
23
|
+
RabbitJobs.logger.info short_message: "Job processed [ok]", _job: self.to_ruby_string, _execution_time: execution_time.to_s.strip
|
24
24
|
rescue
|
25
25
|
log_job_error($!)
|
26
26
|
run_on_error_hooks($!)
|
@@ -95,9 +95,9 @@ module RabbitJobs
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def log_job_error(error)
|
98
|
-
RabbitJobs.logger.
|
99
|
-
|
100
|
-
|
98
|
+
RabbitJobs.logger.error(short_message: "Job processed [error]",
|
99
|
+
_job: self.to_ruby_string, full_message: _cleanup_backtrace(error.backtrace).join("\r\n"))
|
100
|
+
|
101
101
|
Airbrake.notify(error, session: {args: self.to_ruby_string}) if defined?(Airbrake)
|
102
102
|
RabbitJobs::ErrorMailer.report_error(self, error) rescue nil
|
103
103
|
end
|
@@ -28,8 +28,7 @@ module RabbitJobs
|
|
28
28
|
raise "Disconnected from #{RJ.config.server}. Connection status: #{connection.try(:status).inspect}"
|
29
29
|
end
|
30
30
|
rescue
|
31
|
-
RabbitJobs.logger.
|
32
|
-
RabbitJobs.logger.warn $!.backtrace.join("\n")
|
31
|
+
RabbitJobs.logger.error $!.message
|
33
32
|
raise $!
|
34
33
|
end
|
35
34
|
|
@@ -52,7 +52,7 @@ module RabbitJobs
|
|
52
52
|
RabbitJobs.publish_to(config[:queue], klass_name, *params)
|
53
53
|
rescue
|
54
54
|
RabbitJobs.logger.warn "Failed to publish #{klass_name}:\n #{$!}\n params = #{params.inspect}"
|
55
|
-
RabbitJobs.logger.
|
55
|
+
RabbitJobs.logger.error $!
|
56
56
|
end
|
57
57
|
|
58
58
|
def rufus_scheduler
|
data/lib/rabbit_jobs/version.rb
CHANGED
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.18
|
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-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|