rookout 0.1.14 → 0.1.15

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
  SHA256:
3
- metadata.gz: 768d976e24dea5552d46df61aae43d63ca09bc620cc5ea04f2d350ce0d1fdd26
4
- data.tar.gz: 9261c7aea1c3e1269129ddfe9941c4241e8ee6107be39e839c7e35be36156d80
3
+ metadata.gz: a79d1186aec6390fdce4b56f19a1a2586e91837e51e1e40d70b3290284f8ca0a
4
+ data.tar.gz: bc0400c6406c42355a9aec84ad0655c37ae7546464e5b80bbc9d3d8a7ae1c330
5
5
  SHA512:
6
- metadata.gz: b3fae0189f0f86b8e61c4ed763677882760f2d155a704e08504751f0e31aac3325660bcd089fcf5d393a9e6de3627d6e767fee5c8a3962d7d7b3d6e17b38e78c
7
- data.tar.gz: 58fb6dddd9364f299d184e637ff4e28c13cad9b9f1bc098324eff01342f0d6b0a0fc35b8853553f1f6f4e8f63145e576b67cdfd2bf519509ad19ea72bab1d318
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
- @connected = false
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
- @connected = false
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
- @connected = true
25
- @last_successful_connection = Time.now
20
+ @connect_time = Time.now
26
21
  end
27
22
 
28
23
  private
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- COMMIT = "982cb7ee1b842b306f30a9b5bdcf5a5410528499".freeze
2
+ COMMIT = "c6e9d699d0dd8a6d17e8c466c18ccc082a29e5aa".freeze
3
3
  end
@@ -22,19 +22,14 @@ module Rookout
22
22
 
23
23
  require_relative "rookout_singleton"
24
24
 
25
- # If we are running post fork, use previous start_options
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"
@@ -1,3 +1,3 @@
1
1
  module Rookout
2
- VERSION = "0.1.14".freeze
2
+ VERSION = "0.1.15".freeze
3
3
  end
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.14
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: 2020-12-28 00:00:00.000000000 Z
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