fix upload crash

This commit is contained in:
YouROK
2020-12-25 13:23:13 +03:00
parent e81bcf8752
commit 6d6f598fd7

View File

@@ -42,9 +42,18 @@ func torrentUpload(c *gin.Context) {
log.TLogln("error upload torrent:", err)
continue
}
if save {
torr.SaveTorrentToDB(tor)
}
go func() {
if !tor.GotInfo() {
log.TLogln("error add torrent:", "timeout connection torrent")
return
}
if save {
torr.SaveTorrentToDB(tor)
}
}()
retList = append(retList, tor.Status())
}
c.JSON(200, retList)