mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
decrease timeouts and add client check on add new torrent
This commit is contained in:
@@ -196,12 +196,12 @@ func SetSettings(set *sets.BTSets) {
|
|||||||
sets.SetBTSets(set)
|
sets.SetBTSets(set)
|
||||||
log.TLogln("drop all torrents")
|
log.TLogln("drop all torrents")
|
||||||
dropAllTorrent()
|
dropAllTorrent()
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 1)
|
||||||
log.TLogln("disconect")
|
log.TLogln("disconect")
|
||||||
bts.Disconnect()
|
bts.Disconnect()
|
||||||
log.TLogln("connect")
|
log.TLogln("connect")
|
||||||
bts.Connect()
|
bts.Connect()
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 1)
|
||||||
log.TLogln("end set settings")
|
log.TLogln("end set settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,12 +212,12 @@ func SetDefSettings() {
|
|||||||
sets.SetDefault()
|
sets.SetDefault()
|
||||||
log.TLogln("drop all torrents")
|
log.TLogln("drop all torrents")
|
||||||
dropAllTorrent()
|
dropAllTorrent()
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 1)
|
||||||
log.TLogln("disconect")
|
log.TLogln("disconect")
|
||||||
bts.Disconnect()
|
bts.Disconnect()
|
||||||
log.TLogln("connect")
|
log.TLogln("connect")
|
||||||
bts.Connect()
|
bts.Connect()
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 1)
|
||||||
log.TLogln("end set default settings")
|
log.TLogln("end set default settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ type Torrent struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error) {
|
func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error) {
|
||||||
// TODO panic when settings sets
|
// https://github.com/anacrolix/torrent/issues/747
|
||||||
if bt == nil {
|
if bt == nil || bt.client == nil {
|
||||||
return nil, errors.New("BT client not connected")
|
return nil, errors.New("BT client not connected")
|
||||||
}
|
}
|
||||||
switch settings.BTsets.RetrackersMode {
|
switch settings.BTsets.RetrackersMode {
|
||||||
|
|||||||
Reference in New Issue
Block a user