A more comprehensive delete process

This commit is contained in:
Ben Sarmiento
2024-01-24 12:35:45 +01:00
parent 52a31abe35
commit a802416d04

View File

@@ -77,11 +77,12 @@ func (t *TorrentManager) RefreshTorrents() []string {
// ensure delete
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
t.ensureDelete.Each(func(fixerID string) bool {
if torrent, exists := infoCache.Get(fixerID); exists && torrent.AnyInProgress() {
torrent, exists := infoCache.Get(fixerID)
if exists && torrent.AnyInProgress() {
return false
}
t.log.Debugf("Ensuring that torrent id=%s is deleted", fixerID)
t.Api.DeleteTorrent(fixerID)
t.Delete(t.GetKey(torrent), true)
return false
})