copy_tuner_client 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/Gemfile.lock +1 -1
- data/lib/copy_tuner_client/process_guard.rb +19 -2
- data/lib/copy_tuner_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4776a7f970369d47eba083c2c2e81a0362970968
|
4
|
+
data.tar.gz: d08c3a482222973eaa1c92c69bd55a855c2739ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2ff8480739ff495314fe784c7abbb1a8badda4c617501946fa600d0af100443dc5a9a1e14a2aac8a26786cc59c1c96779d29e5c0158a7ee9dc48c357a89958b
|
7
|
+
data.tar.gz: 74d0ca26099480f98b68d76d7009aa9705c22d16467f848628ab6f7be44378a039994c5251c47ffc8b6b69b3ffdfe5d1417deaa04bd67ccb33baf41554f1901b
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -30,7 +30,7 @@ module CopyTunerClient
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def spawner?
|
33
|
-
passenger_spawner? || unicorn_spawner? || delayed_job_spawner?
|
33
|
+
passenger_spawner? || unicorn_spawner? || delayed_job_spawner? || puma_spawner?
|
34
34
|
end
|
35
35
|
|
36
36
|
def passenger_spawner?
|
@@ -45,6 +45,10 @@ module CopyTunerClient
|
|
45
45
|
$0.include?('delayed_job')
|
46
46
|
end
|
47
47
|
|
48
|
+
def puma_spawner?
|
49
|
+
$0.include?('puma')
|
50
|
+
end
|
51
|
+
|
48
52
|
def register_spawn_hooks
|
49
53
|
if defined?(PhusionPassenger)
|
50
54
|
register_passenger_hook
|
@@ -52,6 +56,8 @@ module CopyTunerClient
|
|
52
56
|
register_unicorn_hook
|
53
57
|
elsif defined?(Delayed::Worker)
|
54
58
|
register_delayed_hook
|
59
|
+
elsif defined?(Puma::Cluster)
|
60
|
+
register_puma_hook
|
55
61
|
end
|
56
62
|
end
|
57
63
|
|
@@ -77,7 +83,6 @@ module CopyTunerClient
|
|
77
83
|
def register_delayed_hook
|
78
84
|
@logger.info("Registered Delayed::Job start hook")
|
79
85
|
poller = @poller
|
80
|
-
|
81
86
|
Delayed::Worker.class_eval do
|
82
87
|
alias_method :start_without_copy_tuner, :start
|
83
88
|
define_method :start do
|
@@ -87,6 +92,18 @@ module CopyTunerClient
|
|
87
92
|
end
|
88
93
|
end
|
89
94
|
|
95
|
+
def register_puma_hook
|
96
|
+
@logger.info("Registered Puma fork hook")
|
97
|
+
poller = @poller
|
98
|
+
Puma::Cluster.class_eval do
|
99
|
+
alias_method :worker_without_copy_tuner, :worker
|
100
|
+
define_method :worker do |index, master|
|
101
|
+
poller.start
|
102
|
+
worker_without_copy_tuner(index, master)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
90
107
|
def register_exit_hooks
|
91
108
|
at_exit do
|
92
109
|
@cache.flush
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SonicGarden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|