scout_apm 0.9.7.pre2 → 0.9.7.pre3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aec62477f0a794720ae3147888ae6525f3c5fcd
4
- data.tar.gz: 0348a870ef42aebc7a2ef2a5c82488d5c93e489b
3
+ metadata.gz: 25aab00b1c404c8862106f78cf50c6c1d8858c0a
4
+ data.tar.gz: 93f051bfce0749e1706ac6eb9f869c7b5c1020d9
5
5
  SHA512:
6
- metadata.gz: f8625d4209e97a51f1411e39689887841670653546d3ad281a6d1eccbb1f5429ee74249439a0c519beb74f84feee0510772889d0bbff9f379e2bf95003716989
7
- data.tar.gz: 1d3c8307e2f34b95fe13a00e77a2a22edc786efcf8a60bc5c3bfba54779ec911e20ca3ce3b59b834e379b49be619e6c92680bbc5ad87f0b4d0c5ce105d85468f
6
+ metadata.gz: c909c0c8dd205dbb7602e2be3bda38d25a52c08e7bc4ac50839285ef01e24379de8aa154f6c7b561931ad3a35a6d8ac722c4c1544c778d60d6b745e8554bc3d1
7
+ data.tar.gz: 10769f5a0057b7ee12ab17629541861fe142739620d913e8f735eb2fad63f157ed815eeb27692f47281badd46c7ad765a10d631cbbdc6df046ee31dea3a3fc71
@@ -5,7 +5,7 @@ module ScoutApm
5
5
  def initialize(app)
6
6
  @app = app
7
7
  @attempts = 0
8
- @started = false
8
+ @started = ScoutApm::Agent.instance.started?
9
9
  end
10
10
 
11
11
  # If we get a web request in, then we know we're running in some sort of app server
@@ -13,18 +13,19 @@ module ScoutApm
13
13
  if @started || @attempts > MAX_ATTEMPTS
14
14
  @app.call(env)
15
15
  else
16
- begin
17
- @attempts += 1
18
- ScoutApm::Agent.instance.start(:skip_app_server_check => true)
19
- @started = ScoutApm::Agent.instance.started?
20
- rescue => e
21
- # Can't be sure of any logging here, so fall back to ENV var and STDOUT
22
- if ENV["SCOUT_LOG_LEVEL"] == "debug"
23
- STDOUT.puts "Failed to start via Middleware: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
24
- end
25
- ensure
26
- @app.call(env)
27
- end
16
+ attempt_to_start_agent
17
+ @app.call(env)
18
+ end
19
+ end
20
+
21
+ def attempt_to_start_agent
22
+ @attempts += 1
23
+ ScoutApm::Agent.instance.start(:skip_app_server_check => true)
24
+ @started = ScoutApm::Agent.instance.started?
25
+ rescue => e
26
+ # Can't be sure of any logging here, so fall back to ENV var and STDOUT
27
+ if ENV["SCOUT_LOG_LEVEL"] == "debug"
28
+ STDOUT.puts "Failed to start via Middleware: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
28
29
  end
29
30
  end
30
31
  end
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "0.9.7.pre2"
2
+ VERSION = "0.9.7.pre3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7.pre2
4
+ version: 0.9.7.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes