optic-rails 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcc9f8bb82836edbf9bb1a24ab56e59f8f6f7b1e73e7dfe209c32c067422be1b
4
- data.tar.gz: 02b588f7732943fcd2f99d81d39228232361a8df7e3bb24da488b0854c533371
3
+ metadata.gz: eb3bf5673fc1c40fb7f1cdc7abef4bd03fd1d000afe33c49d0bb8bebd889bac0
4
+ data.tar.gz: cb952112609b5d0f06fb65f292b3b4172eec79af5271b68d574315b899162f20
5
5
  SHA512:
6
- metadata.gz: 0ed9472bba1f21b46c459bfea0c6c06994d62664647fef37a235ea8bf54df5956c051576ca657f2349eeba0e2ebfa5eae4f28c36b35b04b344b3191d6a63c4c7
7
- data.tar.gz: 7e09979a92dcf7e6cfd1f6df670eb58be0a65070272ae7c92dc82a8241952f0d3c335f62db9393f0100c5847b2b65dea9d98fb7339a3a099f31b6a801cb974a1
6
+ metadata.gz: a83107da3ea9e779a5874777ad4adf391dffd4f2d3015cf1ce81291d8e4ecfd7aa3fa7aaca0a329821366e5aa15376462b17878ba5c7b2279c7a630a3baab02f
7
+ data.tar.gz: b903f2e65c71aabc8949e8e87ab3910020869ef90286c9639facee956963f26c9a182c17488b3cba3bac2af9651adb134b3ba9547d168ce10b3982601d10bf8e
@@ -10,18 +10,23 @@ module Optic
10
10
  logger = Logger.new(STDOUT)
11
11
  logger.level = Logger::WARN
12
12
 
13
- # Get configuration
14
- if !app.config.respond_to? :optic_api_key
15
- logger.warn "No optic_api_key found in Rails configuration, Optic agent will not run"
16
- next
17
- end
18
-
19
- api_key = app.config.optic_api_key
20
- uri = app.config.optic_uri
13
+ did_print_api_key_warning = false
21
14
 
22
15
  logger.debug "Starting supervisor thread"
23
16
  supervisor = Thread.new do
24
17
  loop do
18
+ sleep 5.0
19
+
20
+ # Get configuration
21
+ if !app.config.respond_to? :optic_api_key
22
+ logger.warn "No optic_api_key found in Rails configuration, Optic agent will not run" unless did_print_api_key_warning
23
+ did_print_api_key_warning = true
24
+ next
25
+ end
26
+
27
+ api_key = app.config.optic_api_key
28
+ uri = app.config.respond_to?(:optic_uri) ? app.config.optic_uri : "wss://tikal-api-staging.herokuapp.com"
29
+
25
30
  logger.debug "Starting worker thread"
26
31
  worker = Thread.new do
27
32
  EventMachine.run do
@@ -80,8 +85,6 @@ module Optic
80
85
  end
81
86
 
82
87
  logger.info "Supervisor thread detected dead worker, sleeping"
83
- sleep 5.0
84
- logger.debug "Supervisor thread done sleeping"
85
88
  end
86
89
  end
87
90
  end
@@ -1,5 +1,5 @@
1
1
  module Optic
2
2
  module Rails
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optic-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Vaynshtok
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: action_cable_client