rookout 0.1.14 → 0.1.15
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/rookout/com_ws/agent_com_ws.rb +2 -1
- data/lib/rookout/com_ws/backoff.rb +5 -10
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/interface.rb +18 -10
- data/lib/rookout/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: a79d1186aec6390fdce4b56f19a1a2586e91837e51e1e40d70b3290284f8ca0a
|
4
|
+
data.tar.gz: bc0400c6406c42355a9aec84ad0655c37ae7546464e5b80bbc9d3d8a7ae1c330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 181118c9440177b284e30570420d4b12bb5d9e5885605c2081695b07e128828460653fc74bfa8123cc0c87f1d5ec9d210eda05a553b64fd7cf19610cceb2ecb5
|
7
|
+
data.tar.gz: 52f5f5a5c62b617f8936c5ee5e9ff6b3a5c2bad83dce5ea912275dcc0a762e636dae84b37cfa78803208247cc5d560ae24002d67b74452e91430f3e9e8280568
|
@@ -100,10 +100,11 @@ module Rookout
|
|
100
100
|
|
101
101
|
while @running
|
102
102
|
begin
|
103
|
-
backoff.before_connection_attempt
|
104
103
|
client = open_new_connection
|
105
104
|
|
106
105
|
Logger.instance.debug "WebSocket connected successfully"
|
106
|
+
Logger.instance.info "Finished initialization"
|
107
|
+
|
107
108
|
@token_valid = true
|
108
109
|
backoff.after_connect
|
109
110
|
|
@@ -4,25 +4,20 @@ module Rookout
|
|
4
4
|
|
5
5
|
class Backoff
|
6
6
|
def initialize
|
7
|
-
@
|
8
|
-
@last_successful_connection = Time.mktime 1970
|
9
|
-
reset_backoff
|
10
|
-
end
|
11
|
-
|
12
|
-
def before_connection_attempt
|
13
|
-
return unless Time.new > @last_successful_connection + Config.backoff_reset_time
|
7
|
+
@connect_time = nil
|
14
8
|
reset_backoff
|
15
9
|
end
|
16
10
|
|
17
11
|
def after_disconnect
|
18
|
-
@
|
12
|
+
reset_backoff if @connect_time && Time.new > @connect_time + Config.backoff_reset_time
|
13
|
+
@connect_time = nil
|
14
|
+
|
19
15
|
sleep @next_backoff
|
20
16
|
@next_backoff = [@next_backoff * 2, Config.backoff_max_time].min
|
21
17
|
end
|
22
18
|
|
23
19
|
def after_connect
|
24
|
-
@
|
25
|
-
@last_successful_connection = Time.now
|
20
|
+
@connect_time = Time.now
|
26
21
|
end
|
27
22
|
|
28
23
|
private
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/interface.rb
CHANGED
@@ -22,19 +22,14 @@ module Rookout
|
|
22
22
|
|
23
23
|
require_relative "rookout_singleton"
|
24
24
|
|
25
|
-
|
26
|
-
if options[:post_fork]
|
27
|
-
# Don't re-enable the fork handler
|
28
|
-
@start_options[:fork] = false
|
29
|
-
else
|
30
|
-
configure_globals options
|
31
|
-
|
32
|
-
@start_options = configure_start_options options
|
33
|
-
print_config @start_options
|
34
|
-
end
|
25
|
+
configure options
|
35
26
|
|
36
27
|
rook = RookoutSingleton.instance
|
37
28
|
rook.connect(**@start_options)
|
29
|
+
rescue LoadError
|
30
|
+
raise if throw_errors
|
31
|
+
STDERR.puts "[Rookout] Failed to load Rookout. Please make sure to force build native extensions by setting" \
|
32
|
+
"'bundle config force_ruby_platform true'"
|
38
33
|
rescue RookMissingToken, RookInvalidToken, RookInvalidOptions, RookVersionNotSupported, RookBadProtobuf => e
|
39
34
|
raise if throw_errors
|
40
35
|
STDERR.puts "[Rookout] Failed to start Rookout: #{e.message}"
|
@@ -62,6 +57,19 @@ module Rookout
|
|
62
57
|
|
63
58
|
TRUE_VALUE = [true, "y", "Y", "yes", "Yes", "YES", "true", "True", "TRUE", "1"].freeze
|
64
59
|
|
60
|
+
def configure options
|
61
|
+
# If we are running post fork, use previous start_options
|
62
|
+
if options[:post_fork]
|
63
|
+
# Don't re-enable the fork handler
|
64
|
+
@start_options[:fork] = false
|
65
|
+
else
|
66
|
+
configure_globals options
|
67
|
+
|
68
|
+
@start_options = configure_start_options options
|
69
|
+
print_config @start_options
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
def verify_env
|
66
74
|
# Only test alpine
|
67
75
|
return unless File.exist? "/etc/alpine-release"
|
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rookout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|