diff options
-rw-r--r-- | lib/unicorn.rb | 4 | ||||
-rw-r--r-- | test/exec/test_exec.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 9d40287..44d1b6d 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -179,8 +179,10 @@ module Unicorn stop(false) break when 'USR1' # rotate logs - kill_each_worker('USR1') + logger.info "master rotating logs..." Unicorn::Util.reopen_logs + logger.info "master done rotating logs" + kill_each_worker('USR1') when 'USR2' # exec binary, stay alive in case something went wrong reexec when 'WINCH' diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index fc8ac26..ea9fc7c 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -300,7 +300,7 @@ end sleep DEFAULT_RES log = File.readlines(rotate.path) end - assert_equal 4, log.grep(/rotating logs\.\.\./).size + assert_equal 4, log.grep(/worker=\d+ rotating logs\.\.\./).size assert_equal 0, log.grep(/done rotating logs/).size tries = DEFAULT_TRIES @@ -309,7 +309,7 @@ end sleep DEFAULT_RES log = File.readlines(COMMON_TMP.path) end - assert_equal 4, log.grep(/done rotating logs/).size + assert_equal 4, log.grep(/worker=\d+ done rotating logs/).size assert_equal 0, log.grep(/rotating logs\.\.\./).size assert_nothing_raised { Process.kill('QUIT', pid) } status = nil |