Explorar el Código

Merge pull request #762 from ferd/explicit-cache-paths

Displays package caching actions
pull/680/merge
Tristan Sloughter hace 9 años
padre
commit
e385c19168
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      src/rebar_pkg_resource.erl

+ 3
- 1
src/rebar_pkg_resource.erl Ver fichero

@ -37,11 +37,13 @@ download(TmpDir, Pkg={pkg, Name, Vsn}, State) ->
cached_download(TmpDir, CachePath, Pkg={pkg, Name, Vsn}, Url, ETag, State) ->
case request(Url, ETag) of
{ok, cached} ->
?INFO("Version cached at ~s is up to date, reusing it", [CachePath]),
serve_from_cache(TmpDir, CachePath, Pkg, State);
{ok, Body, NewETag} ->
?INFO("Downloaded package, caching at ~s", [CachePath]),
serve_from_download(TmpDir, CachePath, Pkg, NewETag, Body, State);
error when ETag =/= false ->
?DEBUG("Download ~s error, using ~s from cache", [Url, CachePath]),
?INFO("Download error, using cached file at ~s", [CachePath]),
serve_from_cache(TmpDir, CachePath, Pkg, State);
error ->
{fetch_fail, Name, Vsn}

Cargando…
Cancelar
Guardar