lib/liberty_buildpack/util/cache/download_cache.rb
# Creates an instance of the cache that is backed by a number of filesystem locations.  The first argument
# (+mutable_cache_root+) is the only location that downloaded files will be stored in.
#
# @param [Pathname] mutable_cache_root the filesystem location in which find cached files in.  This will also be
#                                      the location that all downloaded files are written to.
# @param [Pathname] immutable_cache_roots other filesystem locations to find cached files in.  No files will be
#                                         written to these locations.
Creates an instance of the cache that is backed by a number of filesystem locations.  The first argument
(+mutable_cache_root+) is the only location that downloaded files will be stored in.
Creates an instance of the cache that is backed by a number of filesystem locations . The first argument ( + mutable_cache_root + ) is the only location that downloaded files will be stored in .
def attempt_update(cached_file, http, uri)
          request = request uri, cached_file
          request.basic_auth uri.user, uri.password if uri.user && uri.password
          AuthenticationUtils.authorization request, uri.to_s
          failures = 0
          begin
            attempt http, request, cached_file
          rescue InferredNetworkFailure, *HTTP_ERRORS => e
            if (failures += 1) > FAILURE_LIMIT
              InternetAvailability.instance.available false, "Request failed: #{e.message}"
              raise e
            else
              @logger.warn { "Request failure #{failures}, retrying: #{e.message}" }
              retry
            end
          end
        end
def attempt_update ( cached_file , http , uri ) request = request uri , cached_file request . basic_auth uri . user , uri . password if uri . user && uri . password AuthenticationUtils . authorization request , uri . to_s failures = 0 begin attempt http , request , cached_file rescue InferredNetworkFailure , * HTTP_ERRORS => e if ( failures += 1 ) > FAILURE_LIMIT InternetAvailability . instance . available false , "Request failed: #{e.message}" raise e else @logger . warn { "Request failure #{failures}, retrying: #{e.message}" } retry end end end
Creates an instance of the cache that is backed by a number of filesystem locations.
Creates an instance of the cache that is backed by a number of filesystem locations .
cached_file
http
uri
immutable_cache_roots other filesystem locations to find cached files in. No files will be written to these locations.
immutable_cache_roots other filesystem locations to find cached files in . No files will be written to these locations .