Merge pull request #116 from skunkie/issue-115

fix a delay when saving settings
This commit is contained in:
YouROK
2021-09-20 16:46:14 +03:00
committed by GitHub

View File

@@ -193,12 +193,12 @@ func SetSettings(set *sets.BTSets) {
if sets.ReadOnly { if sets.ReadOnly {
return return
} }
sets.SetBTSets(set)
log.TLogln("drop all torrents") log.TLogln("drop all torrents")
dropAllTorrent() dropAllTorrent()
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)
log.TLogln("disconect") log.TLogln("disconect")
bts.Disconnect() bts.Disconnect()
sets.SetBTSets(set)
log.TLogln("connect") log.TLogln("connect")
bts.Connect() bts.Connect()
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)
@@ -209,12 +209,12 @@ func SetDefSettings() {
if sets.ReadOnly { if sets.ReadOnly {
return return
} }
sets.SetDefault()
log.TLogln("drop all torrents") log.TLogln("drop all torrents")
dropAllTorrent() dropAllTorrent()
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)
log.TLogln("disconect") log.TLogln("disconect")
bts.Disconnect() bts.Disconnect()
sets.SetDefault()
log.TLogln("connect") log.TLogln("connect")
bts.Connect() bts.Connect()
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)