add comments for mechanize patch

This commit is contained in:
Albert Yi
2018-05-09 16:51:12 -07:00
parent 5bca31bad1
commit c658e7d22a

View File

@@ -1,6 +1,11 @@
require 'mechanize'
if Rails.env.test?
# something about the root certs on the travis ci image causes Mechanize
# to intermittently fail. this is a monkey patch to reset the connection
# after every request to avoid dealing wtiht he issue.
#
# from http://scottwb.com/blog/2013/11/09/defeating-the-infamous-mechanize-too-many-connection-resets-bug/
class Mechanize::HTTP::Agent
MAX_RESET_RETRIES = 10