Permalink
Browse files

sleep after creating ps; conditional route detach

  • Loading branch information...
1 parent dfa1a5a commit 274ae16bba640cf07eb821f1c1e349f4c77430d0 @nzoschke committed Oct 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 config.ru
View
4 config.ru
@@ -9,6 +9,7 @@ run lambda { |env|
# get or create sshd ps
unless @p = @heroku.ps(@app).detect { |p| p["process"] =~ /sshd/ && p["state"] == "up" }
@p = @heroku.ps_run(@app, {:command => "sshd", :type => "sshd"})
+ sleep 1
puts "info: created process #{@p.inspect}"
end
@@ -19,12 +20,11 @@ run lambda { |env|
end
# attach route
- @heroku.route_detach(@app, @r["url"], @r["ps"])
+ @heroku.route_detach(@app, @r["url"], @r["ps"]) if @r["ps"]
@heroku.route_attach(@app, @r["url"], @p["process"])
puts "info: attached route #{@r.inspect} to #{@p["process"]}"
# introspect sshd ps
- sleep 1
logs = ""
@heroku.read_logs(@app) { |chk| logs << chk }

0 comments on commit 274ae16

Please sign in to comment.