Feat: list downloading file

This commit is contained in:
HFO4
2020-02-08 15:37:51 +08:00
parent 356ac8d608
commit d30159579f
6 changed files with 95 additions and 1 deletions

View File

@@ -39,7 +39,15 @@ func (client *RPCService) Init(server, secret string, timeout int, options []int
// Status 查询下载状态
func (client *RPCService) Status(task *model.Download) (rpc.StatusInfo, error) {
return client.caller.TellStatus(task.GID)
res, err := client.caller.TellStatus(task.GID)
if err != nil {
// 失败后重试
util.Log().Debug("无法获取离线下载状态,%s10秒钟后重试", err)
time.Sleep(time.Duration(10) * time.Second)
res, err = client.caller.TellStatus(task.GID)
}
return res, err
}
// Cancel 取消下载