diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:55 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:55 -0700 |
commit | 7a3ebef424f3e7db0a48ae35885c446d79b7d971 (patch) | |
tree | f5cbaa3cd99833ed39a5076a580d20a1d978f27f | |
parent | 08c52c81bc49023a645dd211c4c983a60ac64e13 (diff) | |
download | rainbows-7a3ebef424f3e7db0a48ae35885c446d79b7d971.tar.gz |
Since we export "rainbows.model" to Rack now, we don't have to worry about setting the "SLEEP_CLASS" env for the application.
-rw-r--r-- | t/sleep.ru | 13 | ||||
-rwxr-xr-x | t/t3002-revactor-graceful.sh | 2 | ||||
-rwxr-xr-x | t/t3003-revactor-reopen-logs.sh | 2 |
3 files changed, 11 insertions, 6 deletions
@@ -1,11 +1,16 @@ use Rack::ContentLength use Rack::ContentType -sleep_class = ENV['SLEEP_CLASS'] -sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel -$stderr.puts "sleep_class=#{sleep_class.inspect}" + run lambda { |env| nr = 1 env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f - sleep_class.sleep(nr) + + (case env['rainbows.model'] + when :Revactor + Actor + else + Kernel + end).sleep(nr) + [ 200, {}, [ "Hello\n" ] ] } diff --git a/t/t3002-revactor-graceful.sh b/t/t3002-revactor-graceful.sh index 2a766be..67c6ba3 100755 --- a/t/t3002-revactor-graceful.sh +++ b/t/t3002-revactor-graceful.sh @@ -17,7 +17,7 @@ Rainbows! do end EOF -SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config +rainbows -D sleep.ru -c $unicorn_config wait_for_pid $pid for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null) diff --git a/t/t3003-revactor-reopen-logs.sh b/t/t3003-revactor-reopen-logs.sh index e39160f..8b11c19 100755 --- a/t/t3003-revactor-reopen-logs.sh +++ b/t/t3003-revactor-reopen-logs.sh @@ -19,7 +19,7 @@ Rainbows! do end EOF -SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config +rainbows -D sleep.ru -c $unicorn_config wait_for_pid $pid start=$(date +%s) |