Skip to content

Instantly share code, notes, and snippets.

@ealdent
Created March 9, 2011 16:47
Embed
What would you like to do?
Hack to fix error in resque when a 404 is returned where it shouldn't be
def port_open?(check_url = nil)
begin
check_url ||= url
options[:no_proxy] ? open(check_url, :proxy => nil) : open(check_url)
false
rescue Errno::ECONNREFUSED => e
true
rescue Errno::EPERM => e
# catches the "Operation not permitted" under Cygwin
true
rescue
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment