Don't use the logger from a trap context. Fixes #801.
This commit is contained in:
parent
cda8bd759d
commit
a10c8aa194
1 changed files with 9 additions and 2 deletions
|
@ -31,6 +31,12 @@ module Middleman
|
||||||
::Middleman::Profiling.report("server_start")
|
::Middleman::Profiling.report("server_start")
|
||||||
|
|
||||||
@webrick.start
|
@webrick.start
|
||||||
|
|
||||||
|
# $mm_shutdown is set by the signal handler
|
||||||
|
if $mm_shutdown
|
||||||
|
shutdown
|
||||||
|
exit
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -118,8 +124,9 @@ module Middleman
|
||||||
%w(INT HUP TERM QUIT).each do |sig|
|
%w(INT HUP TERM QUIT).each do |sig|
|
||||||
if Signal.list[sig]
|
if Signal.list[sig]
|
||||||
Signal.trap(sig) do
|
Signal.trap(sig) do
|
||||||
shutdown
|
# Do as little work as possible in the signal context
|
||||||
exit
|
$mm_shutdown = true
|
||||||
|
@webrick.stop
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue