copy_tuner_client 0.4.2 → 0.4.3

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: e5a1d2d35e0f10c245a66e5f9f1f1fe0b5e55b8f
4
- data.tar.gz: 9f6bd6a383a8b9533c361b165e36b6895af20ac4
3
+ metadata.gz: 03ba0b085f868890879331c827dc5b536dd7ab60
4
+ data.tar.gz: 87fde9370a787494eee210acef172e308d3bd712
5
5
  SHA512:
6
- metadata.gz: ad94cec56fa02a2bb263adb2965dacfd970369771a80cfc98653b1c5a8fc7c9a5dae7644dfee97762d6f1c1c4516f6d124f6b0c66132d11dfb6174cfca4cf1a0
7
- data.tar.gz: 0a9704779c56a55e9efc55b2f8b781279ebee8c707e18332f72a78608c10fedcfe5b368827a5a3c4ff25aef7a4705b1533669c397cfbfdd650ad7c32b2950f32
6
+ metadata.gz: b7224992276e3886e74346a54b9de1facf6dbf5140b0da2c29ded50534f61e820525cd1dce5ef865213a496bad59f34a17bf71a797f6010620557c3613fda02b
7
+ data.tar.gz: 5bc71e6e6643e52038c4065e2dd5357b605875720b141f7dde522caa1dd335f6934bf612840abf805217a7da5584fb1a326d5a5f64c5ffe5339c2a6307015b4c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.3
2
+ - bug fix
3
+ - Start poller thread regardless of puma mode. #39
4
+
1
5
  ## 0.4.2
2
6
  - changes
3
7
  - span tag is no longer added to translation text.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- copy_tuner_client (0.4.2)
4
+ copy_tuner_client (0.4.3)
5
5
  i18n (>= 0.5.0)
6
6
  json
7
7
 
@@ -16,6 +16,7 @@ module CopyTunerClient
16
16
  end
17
17
 
18
18
  def start
19
+ @logger.info 'start poller'
19
20
  Thread.new { poll } or logger.error("Couldn't start poller thread")
20
21
  end
21
22
 
@@ -42,7 +42,7 @@ module CopyTunerClient
42
42
  end
43
43
 
44
44
  def puma_spawner?
45
- defined?(Puma::Cluster) && $0.include?('puma')
45
+ defined?(Puma::Runner) && $0.include?('puma')
46
46
  end
47
47
 
48
48
  def delayed_job_spawner?
@@ -97,15 +97,25 @@ module CopyTunerClient
97
97
  end
98
98
 
99
99
  def register_puma_hook
100
- @logger.info("Registered Puma fork hook")
100
+ # If Puma is clustered mode without preload_app, this method is called on worker process.
101
+ # Just start poller and return.
102
+ if $0.include?('cluster worker')
103
+ @logger.info('Puma would be clustered mode without preload_app')
104
+ @poller.start
105
+ return
106
+ end
107
+
108
+ @logger.info('Register Puma fork hook')
109
+ # If Puma is clustered mode with preload_app, this method is called before fork.
110
+ # Delay poller start until Puma::Runner#start_server which is called on worker process.
101
111
  poller = @poller
102
- Puma::Cluster.class_eval do
103
- alias_method :worker_without_copy_tuner, :worker
104
- define_method :worker do |index, master|
112
+ hook_module = Module.new do
113
+ define_method :start_server do
105
114
  poller.start
106
- worker_without_copy_tuner(index, master)
115
+ super()
107
116
  end
108
117
  end
118
+ Puma::Runner.prepend hook_module
109
119
  end
110
120
 
111
121
  def register_exit_hooks
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.4.2'.freeze
3
+ VERSION = '0.4.3'.freeze
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_tuner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SonicGarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-21 00:00:00.000000000 Z
11
+ date: 2017-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n