{"action":"created","issue":{"url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/92","repository_url":"https://api.github.com/repos/lingochamp/FileDownloader","labels_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/92/comments","events_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/92/events","html_url":"https://github.com/lingochamp/FileDownloader/issues/92","id":147108167,"number":92,"title":"新问题，关于自动重试","user":{"login":"ynlh","id":5905971,"avatar_url":"https://avatars.githubusercontent.com/u/5905971?v=3","gravatar_id":"","url":"https://api.github.com/users/ynlh","html_url":"https://github.com/ynlh","followers_url":"https://api.github.com/users/ynlh/followers","following_url":"https://api.github.com/users/ynlh/following{/other_user}","gists_url":"https://api.github.com/users/ynlh/gists{/gist_id}","starred_url":"https://api.github.com/users/ynlh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ynlh/subscriptions","organizations_url":"https://api.github.com/users/ynlh/orgs","repos_url":"https://api.github.com/users/ynlh/repos","events_url":"https://api.github.com/users/ynlh/events{/privacy}","received_events_url":"https://api.github.com/users/ynlh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-09T08:34:24Z","updated_at":"2016-04-09T11:31:11Z","closed_at":null,"body":"测试发现，如果设置了自动重试（比如 3次），我进行如下操作： 下载一个文件，在进行了一段时间后，这时切到后天，主动关闭手机的网络（wifi），这是切回应用，会回调 error，这时我主动重新开始 调用下载，不是（task.start()）而是： FileDownloader.getImpl().create(url).setPath(path).setCallbackProgressTimes(1000).setListener(mFileDownloadListener).start(); 因为这时还没有网络，所以会回调 retry 一次（只有一次），然后 error，这时主动去开启网络，继续重新开始下载，这时下载进度却从 0开始了，不管测试是 第一次回调 error之前重新联网还是 回调了error之后重新联网，都是这样的结果，断点续传失效了。\r\n然后继续测试 建立下载的时候 不设置自动重试的次数，重试以上的过程，主动联网后，再次调用下载，可以断点续传，以前的下载进度存在。"},"comment":{"url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/comments/207773537","html_url":"https://github.com/lingochamp/FileDownloader/issues/92#issuecomment-207773537","issue_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/92","id":207773537,"user":{"login":"Jacksgong","id":6176417,"avatar_url":"https://avatars.githubusercontent.com/u/6176417?v=3","gravatar_id":"","url":"https://api.github.com/users/Jacksgong","html_url":"https://github.com/Jacksgong","followers_url":"https://api.github.com/users/Jacksgong/followers","following_url":"https://api.github.com/users/Jacksgong/following{/other_user}","gists_url":"https://api.github.com/users/Jacksgong/gists{/gist_id}","starred_url":"https://api.github.com/users/Jacksgong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jacksgong/subscriptions","organizations_url":"https://api.github.com/users/Jacksgong/orgs","repos_url":"https://api.github.com/users/Jacksgong/repos","events_url":"https://api.github.com/users/Jacksgong/events{/privacy}","received_events_url":"https://api.github.com/users/Jacksgong/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T11:31:11Z","updated_at":"2016-04-09T11:31:11Z","body":"自动重试这个在 #91 已经修复了。\r\n\r\n👍  恩，我看了下，这个断网以后，再重新下载，确实会导致sofar被覆盖，我已经找到原因了，一会儿处理下。\r\n\r\n很感谢你的细心。"}}