diff options
Diffstat (limited to 'lib/unicorn')
-rw-r--r-- | lib/unicorn/http_server.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index a5bd2c4..40a154d 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -541,14 +541,12 @@ class Unicorn::HttpServer worker = Unicorn::Worker.new(worker_nr) before_fork.call(self, worker) - pid = if @worker_exec - worker_spawn(worker) - else - fork do - after_fork_internal - worker_loop(worker) - exit - end + pid = @worker_exec ? worker_spawn(worker) : fork + + unless pid + after_fork_internal + worker_loop(worker) + exit end @workers[pid] = worker |