Skip to content

Commit

Permalink
Rescue harder
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Nov 6, 2013
1 parent 42df21d commit a2eff83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions code/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ def self.start_process(options)

def self.close_all_fds(exclude_fds)
0.upto(1023) do |fd|
next if exclude_fds.include? fd
IO.new(fd).close rescue nil
begin
next if exclude_fds.include? fd
IO.new(fd).close
rescue Exception
end
end
end

Expand Down
7 changes: 5 additions & 2 deletions code/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ def self.start_process(options={})

def self.close_all_fds(exclude_fds)
0.upto(1023) do |fd|
next if exclude_fds.include? fd
IO.new(fd).close rescue nil
begin
next if exclude_fds.include? fd
IO.new(fd).close
rescue Exception
end
end
end

Expand Down

0 comments on commit a2eff83

Please sign in to comment.