Fetch
Fetch copied to clipboard
How to set timeout?
How to set timeout?
I'm using http default download
final FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(this) .enableRetryOnNetworkGain(true) .setAutoRetryMaxAttempts(2) .setDownloadConcurrentLimit(2) .setHttpDownloader(new HttpUrlConnectionDownloader(Downloader.FileDownloaderType.SEQUENTIAL)) .build(); Fetch.Impl.setDefaultInstanceConfiguration(fetchConfiguration);
call
` request = new Request(Constante.REST_METODO_DOWNLOAD_IMG_PRODUTO_ZIP, DirectoryUtils.getPastaAppSinc().concat("/imgprodutos.zip")); request.setPriority(Priority.HIGH); request.setAutoRetryMaxAttempts(3);
request.setNetworkType(NetworkType.ALL);
request.addHeader("Authorization", "Basic " + encodedCretentials);
fetch.addListener(this);
fetch.enqueue(request, updatedRequest -> {
aguarde(true);
request = updatedRequest;
}, error -> {
aguarde(false);
});`
I have the same question.
Set setHttpDownloader(getOkHttpDownloader()) <<