airbrake-ruby 4.4.0-java → 4.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby/async_sender.rb +21 -10
- data/lib/airbrake-ruby/config.rb +1 -1
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/async_sender_spec.rb +8 -0
- data/spec/config_spec.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: d4e58a8ab700b97a73bb42e4dbbecdb34b383607
|
4
|
+
data.tar.gz: 7d2a2130e69749306f0792eb786237122b0bd514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795644660b305c160cdc8e94efd72c803112680ad65a5229516ac2a0faab59cd346ede0a1c264932adc7a0f1c412fbaeb5347f9d9181fe5fc3f8dcd3ee485192
|
7
|
+
data.tar.gz: 61587145c472a7be1a62ace1cb426f7aa766318676c4999b3fabb6570aaf813d181f5e553ae17edf7e1c08e8f9b99bda5693f682595c7489b22c55653175bd4b
|
@@ -9,6 +9,12 @@ module Airbrake
|
|
9
9
|
class AsyncSender
|
10
10
|
include Loggable
|
11
11
|
|
12
|
+
# @return [String]
|
13
|
+
WILL_NOT_DELIVER_MSG =
|
14
|
+
"%<log_label>s AsyncSender has reached its capacity of %<capacity>s " \
|
15
|
+
"and the following notice will not be delivered " \
|
16
|
+
"Error: %<type>s - %<message>s\nBacktrace: %<backtrace>s\n".freeze
|
17
|
+
|
12
18
|
# @return [ThreadGroup] the list of workers
|
13
19
|
# @note This is exposed for eaiser unit testing
|
14
20
|
# @since v4.0.0
|
@@ -36,7 +42,7 @@ module Airbrake
|
|
36
42
|
# library
|
37
43
|
# @return [Airbrake::Promise]
|
38
44
|
def send(notice, promise)
|
39
|
-
return will_not_deliver(notice) if @unsent.size >= @unsent.max
|
45
|
+
return will_not_deliver(notice, promise) if @unsent.size >= @unsent.max
|
40
46
|
|
41
47
|
@unsent << [notice, promise]
|
42
48
|
promise
|
@@ -115,17 +121,22 @@ module Airbrake
|
|
115
121
|
end
|
116
122
|
end
|
117
123
|
|
118
|
-
def will_not_deliver(notice)
|
119
|
-
|
120
|
-
|
121
|
-
end
|
124
|
+
def will_not_deliver(notice, promise)
|
125
|
+
error = notice[:errors].first
|
126
|
+
|
122
127
|
logger.error(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
128
|
+
format(
|
129
|
+
WILL_NOT_DELIVER_MSG,
|
130
|
+
log_label: LOG_LABEL,
|
131
|
+
capacity: @unsent.max,
|
132
|
+
type: error[:type],
|
133
|
+
message: error[:message],
|
134
|
+
backtrace: error[:backtrace].map do |line|
|
135
|
+
"#{line[:file]}:#{line[:line]} in `#{line[:function]}'"
|
136
|
+
end.join("\n")
|
137
|
+
)
|
127
138
|
)
|
128
|
-
|
139
|
+
promise.reject("AsyncSender has reached its capacity of #{@unsent.max}")
|
129
140
|
end
|
130
141
|
end
|
131
142
|
end
|
data/lib/airbrake-ruby/config.rb
CHANGED
data/spec/async_sender_spec.rb
CHANGED
@@ -49,6 +49,14 @@ RSpec.describe Airbrake::AsyncSender do
|
|
49
49
|
end
|
50
50
|
subject.close
|
51
51
|
end
|
52
|
+
|
53
|
+
it "returns a rejected promise" do
|
54
|
+
promise = Airbrake::Promise.new
|
55
|
+
200.times { subject.send(notice, promise) }
|
56
|
+
expect(promise.value).to eq(
|
57
|
+
'error' => "AsyncSender has reached its capacity of #{queue_size}"
|
58
|
+
)
|
59
|
+
end
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
data/spec/config_spec.rb
CHANGED
@@ -19,7 +19,7 @@ RSpec.describe Airbrake::Config do
|
|
19
19
|
its(:timeout) { is_expected.to be_nil }
|
20
20
|
its(:blacklist_keys) { is_expected.to be_empty }
|
21
21
|
its(:whitelist_keys) { is_expected.to be_empty }
|
22
|
-
its(:performance_stats) { is_expected.to
|
22
|
+
its(:performance_stats) { is_expected.to eq(true) }
|
23
23
|
its(:performance_stats_flush_period) { is_expected.to eq(15) }
|
24
24
|
|
25
25
|
describe "#new" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree-jruby
|