bugsnag 2.8.2 → 2.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/bugsnag/delivery/thread_queue.rb +19 -15
- 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: 5515a540e3fb2c64492e1b17866d1b98e01e3602
|
4
|
+
data.tar.gz: 77d5ca101209931e27c4fb25e29203b44f0f5b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a99a13f3d350116dff3dd9f2312a5b7457d858aad5002bd96a7862916deaefaeca9a9fefb1e4cb54e6e731df1385f31098fdf45a891d18d4e7e96738dadaf4d
|
7
|
+
data.tar.gz: 142b85aa2765f6845195c7fa20f32955e232a79164dfefa1dbc2c47a0b6ee6c38e3f3c52c3c07f3c25f76e4d79fddfd2907a0bdc361977ef946aecb9646ccf9d
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.8.
|
1
|
+
2.8.3
|
@@ -5,10 +5,12 @@ module Bugsnag
|
|
5
5
|
class ThreadQueue < Synchronous
|
6
6
|
MAX_OUTSTANDING_REQUESTS = 100
|
7
7
|
STOP = Object.new
|
8
|
-
|
8
|
+
MUTEX = Mutex.new
|
9
9
|
|
10
10
|
class << self
|
11
11
|
def deliver(url, body, configuration)
|
12
|
+
start_once!
|
13
|
+
|
12
14
|
if queue.length > MAX_OUTSTANDING_REQUESTS
|
13
15
|
Bugsnag.warn("Dropping notification, #{queue.length} outstanding requests")
|
14
16
|
return
|
@@ -22,26 +24,28 @@ module Bugsnag
|
|
22
24
|
|
23
25
|
attr_reader :queue
|
24
26
|
|
25
|
-
def
|
26
|
-
|
27
|
+
def start_once!
|
28
|
+
MUTEX.synchronize do
|
29
|
+
return if @started
|
30
|
+
@started = true
|
31
|
+
|
32
|
+
@queue = Queue.new
|
27
33
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
34
|
+
worker_thread = Thread.new do
|
35
|
+
while x = queue.pop
|
36
|
+
break if x == STOP
|
37
|
+
x.call
|
38
|
+
end
|
32
39
|
end
|
33
|
-
end
|
34
40
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
41
|
+
at_exit do
|
42
|
+
Bugsnag.warn("Waiting for #{queue.length} outstanding request(s)") unless queue.empty?
|
43
|
+
queue.push STOP
|
44
|
+
worker_thread.join
|
45
|
+
end
|
39
46
|
end
|
40
47
|
end
|
41
48
|
end
|
42
|
-
|
43
|
-
# do this once at require time to avoid race conditions
|
44
|
-
start!
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|