FileDownloader icon indicating copy to clipboard operation
FileDownloader copied to clipboard

使用FileDownloadSerialQueue下载,经常会出现下载不全的情况。

Open itsgm opened this issue 4 years ago • 1 comments

FileDownloadSerialQueue queue = new FileDownloadSerialQueue(); FileDownloader.enableAvoidDropFrame();//避免掉帧 for (int i = 0; i < 10; i++) { BaseDownloadTask baseDownloadTask = FileDownloader .getImpl() .create(Constant.URLS[i]) .setAutoRetryTimes(3) .setCallbackProgressTimes(0) .setPath(FileDownloadUtils.getDefaultSaveRootPath()+ "/" + i) .setTag(i) .addFinishListener(new BaseDownloadTask.FinishListener() { @Override public void over(BaseDownloadTask task) { if(task.getStatus() == FileDownloadStatus.completed) LogUtils.debugInfo("sgm", "====completed:" + (int) task.getTag()); } }); queue.enqueue(baseDownloadTask); }

代码是这样写的,经常出现只下载了5,6条完成,而没有下载10条数据,是不是线程阻塞了?

itsgm avatar Jul 27 '20 07:07 itsgm

我也出现了类似情况,每次下载两三个文件,但是最终只有一个文件

javycoder avatar Sep 29 '20 07:09 javycoder