h2ocube_rails_rainbows 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/h2ocube_rails_rainbows.gemspec +1 -1
- data/lib/capistrano/tasks/rainbows.cap +15 -3
- data/lib/generators/source/rainbows.rb.erb +8 -0
- 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: aa4cae7dfaf54eb6d88462be6ee311da398999d1
|
4
|
+
data.tar.gz: b9e5fe6433c2bcd83157c1803399a0d6f7802bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b64c45b2cfc2d1fa8f20c6e72b54c5ac427574276786d2f86988089f346321817de88ac815a892859cae7b5f523f8f3c37308f79f84f000f13db1d0970ffec96
|
7
|
+
data.tar.gz: 75fbb7ec44b76b3f370465af15dc3a329431fa7657407568aa4fcaa331d4cc1e5810ed816b02b6ae2888b201b80abd8903d010087255f2cadbe4fab25de83899
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'h2ocube_rails_rainbows'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.5'
|
8
8
|
spec.authors = ['Ben']
|
9
9
|
spec.email = ['ben@zfben.com']
|
10
10
|
spec.description = %q{Rainbows! helper}
|
@@ -11,8 +11,21 @@ namespace :rainbows do
|
|
11
11
|
desc 'Stop rainbows'
|
12
12
|
task :stop do
|
13
13
|
on roles :app do
|
14
|
-
|
15
|
-
|
14
|
+
pid_exist = 'true' == capture("if [ -e #{shared_path}/pids/rainbows.pid ]; then echo 'true'; fi").strip
|
15
|
+
times = 0
|
16
|
+
until pid_exist && times < 10 do
|
17
|
+
within release_path do
|
18
|
+
execute "kill -s QUIT `cat #{shared_path}/pids/rainbows.pid`;true"
|
19
|
+
end
|
20
|
+
sleep 1
|
21
|
+
pid_exist = 'true' == capture("if [ -e #{shared_path}/pids/rainbows.pid ]; then echo 'true'; fi").strip
|
22
|
+
times = times + 1
|
23
|
+
end
|
24
|
+
|
25
|
+
if times > 9
|
26
|
+
within shared_path do
|
27
|
+
execute :rm, 'pids/rainbows.pid;true'
|
28
|
+
end
|
16
29
|
end
|
17
30
|
end
|
18
31
|
end
|
@@ -34,7 +47,6 @@ namespace :rainbows do
|
|
34
47
|
desc 'Cold Restart rainbows'
|
35
48
|
task :cold_restart do
|
36
49
|
invoke 'rainbows:stop'
|
37
|
-
sleep 3
|
38
50
|
invoke 'rainbows:start'
|
39
51
|
end
|
40
52
|
|
@@ -11,6 +11,14 @@ stdout_path 'log/rainbows.stdout.log'
|
|
11
11
|
|
12
12
|
before_fork do |server, worker|
|
13
13
|
ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord)
|
14
|
+
old_pid = "#{server.config[:pid]}.oldbin"
|
15
|
+
if File.exists?(old_pid) && server.pid != old_pid
|
16
|
+
begin
|
17
|
+
Process.kill("QUIT", File.read(old_pid).to_i)
|
18
|
+
rescue Errno::ENOENT, Errno::ESRCH
|
19
|
+
# someone else did our job for us
|
20
|
+
end
|
21
|
+
end
|
14
22
|
end
|
15
23
|
|
16
24
|
after_fork do |server, worker|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h2ocube_rails_rainbows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbows
|