Them retry khi download module loi va bat truong hop gui lenh update module nhieu lan tu server
This commit is contained in:
23
box/box.go
23
box/box.go
@@ -1000,15 +1000,22 @@ func RequestUpdate_Module(url string, id_engine int) {
|
||||
file.Write_log("API get module :"+url, Path_log_luncher)
|
||||
file.Write_log("Path:"+path, Path_log_luncher)
|
||||
file.Write_log("Download Started", Path_log_luncher)
|
||||
err := DownloadFile(path, url)
|
||||
if err != nil {
|
||||
// panic(err)
|
||||
file.Write_log("Download Error", Path_log_luncher)
|
||||
} else {
|
||||
file.Write_log("Download Finished", Path_log_luncher)
|
||||
file.Write_log("Save thanh cong modules", Path_log_luncher)
|
||||
Res_Server(message.Data.Engines[i].Url, message.Data.Box_id, message.Data.Engines[i].Id)
|
||||
var number_download = 0
|
||||
for {
|
||||
number_download = number_download + 1
|
||||
err := DownloadFile(path, url)
|
||||
if err != nil {
|
||||
// panic(err)
|
||||
file.Write_log("Download Error", Path_log_luncher)
|
||||
} else {
|
||||
file.Write_log("Download Finished", Path_log_luncher)
|
||||
file.Write_log("Save thanh cong modules", Path_log_luncher)
|
||||
Res_Server(message.Data.Engines[i].Url, message.Data.Box_id, message.Data.Engines[i].Id)
|
||||
break
|
||||
}
|
||||
}
|
||||
file.Write_log("Number download module: "+strconv.Itoa(number_download), Path_log_luncher)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user