1.同一个广告位交替更换图片有概率产生图片已下载完成但下载任务表未删的情况

This commit is contained in:
2025-11-11 22:10:42 +08:00
parent fd76fa3a2f
commit 7c9a2c44fd

View File

@@ -142,6 +142,11 @@ public class DownLoadManeger {
TaskQueue.getInstance().remove(downLoadTaskBean);
TaskQueue.getInstance().add(new DownLoadTaskThread(downLoadTaskBean, observer));
}
}else if(downLoadTaskBean.getTaskType()==0){//图片文件下载完成 删除downloadtaskbean表数据脏数据
File imgFile = new File(downLoadTaskBean.getPath()+downLoadTaskBean.getFileName());
if(imgFile.exists()&&imgFile.length()==downLoadTaskBean.getTotal()){
DaoManager.getInstance().delete(DownLoadTaskBean.class,downLoadTaskBean);
}
}
if(!file.exists()&&downLoadTaskBean.getCurrentProgress()==0){
LogUtils.loge("power down but downloadstaskbean table remain task");