mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
set short timeouts in GetTorrent, NewTorrent and Preload log
This commit is contained in:
@@ -87,9 +87,13 @@ func SaveTorrentToDB(torr *Torrent) {
|
||||
|
||||
func GetTorrent(hashHex string) *Torrent {
|
||||
hash := metainfo.NewHashFromHex(hashHex)
|
||||
timeout := time.Second * time.Duration(sets.BTsets.TorrentDisconnectTimeout)
|
||||
if timeout > time.Minute {
|
||||
timeout = time.Minute
|
||||
}
|
||||
tor := bts.GetTorrent(hash)
|
||||
if tor != nil {
|
||||
tor.AddExpiredTime(time.Minute)
|
||||
tor.AddExpiredTime(timeout)
|
||||
return tor
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user