lingochamp / lingochamp/FileDownloader
下载完成状态更新问题!
@rantianhua is already working on this.
Since Sep 8, 2018.
- Dominant language
- Java
- Stars
- 11.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
RemitDatabase
@Override public void updateCompleted(int id, long total) {
this.cachedDatabase.updateCompleted(id, total);
if (isNoNeedUpdateToRealDB(id)) {
handler.removeMessages(id);
if (handlingId.get() == id) {
parkThread = Thread.currentThread();
handler.sendEmptyMessage(WHAT_CLEAN_LOCK);
LockSupport.park();
this.realDatabase.updateCompleted(id, total);
}
}
else {
this.realDatabase.updateCompleted(id, total);
}
freeToDBIdList.remove((Integer) id);
}
如下载接近完成(暂停状态),只要下载速度稍快,下载完成状态会永远得不到更新(更新数据库时间设置稍大2000ms),重新打开APP会变成原来的暂停状态! 因完成状态的特殊性是否考虑在该方法中直接调用 this.realDatabase.updateCompleted(id, total);
以避免上述问题?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.