perf: slow down DHT announcing on errors (#1186)

This commit is contained in:
Levi authored and GitHub committed 2026-01-14 20:04:21 +08:00
1 parent f86a379f93
commit c9626cb389
17 files changed
+573 -563

No files matched your search

+3 -2
View File
@@ -110,6 +110,7 @@ func (f *Fetcher) Start() (err error) {
return
}
}
files := f.torrent.Files()
// If the user does not specify the file to download, all files will be downloaded by default
if f.data.Progress == nil {
@@ -129,12 +130,12 @@ func (f *Fetcher) Start() (err error) {
file.Download()
}
}
f.torrent.AllowDataDownload()
return
}
func (f *Fetcher) Pause() (err error) {
f.torrentReady.Store(false)
f.safeDrop()
f.torrent.DisallowDataDownload()
return
}