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 +4 -4
- data/lib/optic/rails/railtie.rb +13 -10
- data/lib/optic/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb3bf5673fc1c40fb7f1cdc7abef4bd03fd1d000afe33c49d0bb8bebd889bac0
|
4
|
+
data.tar.gz: cb952112609b5d0f06fb65f292b3b4172eec79af5271b68d574315b899162f20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a83107da3ea9e779a5874777ad4adf391dffd4f2d3015cf1ce81291d8e4ecfd7aa3fa7aaca0a329821366e5aa15376462b17878ba5c7b2279c7a630a3baab02f
|
7
|
+
data.tar.gz: b903f2e65c71aabc8949e8e87ab3910020869ef90286c9639facee956963f26c9a182c17488b3cba3bac2af9651adb134b3ba9547d168ce10b3982601d10bf8e
|
data/lib/optic/rails/railtie.rb
CHANGED
@@ -10,18 +10,23 @@ module Optic
|
|
10
10
|
logger = Logger.new(STDOUT)
|
11
11
|
logger.level = Logger::WARN
|
12
12
|
|
13
|
-
|
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
|
data/lib/optic/rails/version.rb
CHANGED
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.
|
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-
|
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
|