Skip to content

Commit

Permalink
Merge pull request #27 from pyromaniac/master
Browse files Browse the repository at this point in the history
Fork bomb fix
  • Loading branch information
DAddYE committed Apr 24, 2013
2 parents f265b65 + a0f6eec commit 0fcd088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/forever/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def initialize(options={}, &block)
if forking
begin
GC.start
pids << fork { job_call(job) }
pids << Process.detach(fork { job_call(job) })
rescue Errno::EAGAIN
puts "\n\nWait all processes since os cannot create a new one\n\n"
Process.waitall
Expand All @@ -121,7 +121,7 @@ def initialize(options={}, &block)
end

# Detach zombies, our ps will be happier
pids.delete_if { |p| Process.detach(p).stop? }
pids.delete_if { |p| p.stop? }

sleep 0.5
end
Expand Down

0 comments on commit 0fcd088

Please sign in to comment.