Prevent double repairs
This commit is contained in:
@@ -23,12 +23,12 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
for i := range instances {
|
||||
wg.Add(1)
|
||||
idx := i // capture the loop variable
|
||||
idx := i
|
||||
_ = t.workerPool.Submit(func() {
|
||||
defer wg.Done()
|
||||
infoChan <- t.getMoreInfo(instances[idx])
|
||||
})
|
||||
wg.Add(1)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
@@ -43,7 +43,7 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
||||
noInfoCount++
|
||||
continue
|
||||
}
|
||||
if !info.AllInProgress() {
|
||||
if !info.AnyInProgress() {
|
||||
freshKeys.Add(info.AccessKey)
|
||||
}
|
||||
if torrent, exists := allTorrents.Get(info.AccessKey); !exists {
|
||||
|
||||
Reference in New Issue
Block a user