Created
March 9, 2011 16:47
-
-
Save ealdent/862518 to your computer and use it in GitHub Desktop.
Hack to fix error in resque when a 404 is returned where it shouldn't be
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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