protocol/communities/manager_archive.go
ArchiveManager
has 23 methods (exceeds 21 allowed). Consider refactoring. Open
Open
type ArchiveManager struct {
torrentConfig *params.TorrentConfig
torrentClient *torrent.Client
torrentTasks map[string]metainfo.Hash
historyArchiveDownloadTasks map[string]*HistoryArchiveDownloadTask
Avoid deeply nested control flow statements. Open
Open
if hasArchive {
continue
}
Avoid deeply nested control flow statements. Open
Open
if err != nil {
return nil, err
}
Avoid deeply nested control flow statements. Open
Open
if len(existingArchiveIDs) == len(index.Archives) {
m.logger.Debug("download cancelled, no new archives")
return downloadTaskInfo, nil
}
Avoid deeply nested control flow statements. Open
Open
for {
select {
case <-downloadTicker.C:
done := true
for i = startIndex; i < endIndex; i++ {
Avoid deeply nested control flow statements. Open
Open
if err != nil {
return nil, err
}
Avoid deeply nested control flow statements. Open
Open
if err != nil {
m.logger.Error("couldn't save message archive ID", zap.Error(err))
continue
}
Avoid deeply nested control flow statements. Open
Open
if existingHash == hash {
hasArchive = true
break
}
Avoid deeply nested control flow statements. Open
Open
for i = startIndex; i < endIndex; i++ {
piecesCompleted[i] = false
}