Clear download and unrestrict maps

This commit is contained in:
Ben Adrian Sarmiento
2024-07-11 16:50:22 +02:00
parent b0363edbbb
commit b9699c8a3e
2 changed files with 4 additions and 6 deletions

View File

@@ -381,6 +381,10 @@ func (t *TorrentManager) mountNewDownloads() {
token := t.Config.GetToken()
tokenMap, _ := t.rd.UnrestrictMap.Get(token)
// clear maps
tokenMap.Clear()
t.DownloadMap.Clear()
downloads := t.rd.GetDownloads()
mountedCount := 0
for i := range downloads {
@@ -426,10 +430,8 @@ func (t *TorrentManager) StartDownloadsJob() {
for {
select {
case <-remountTicker.C:
t.DownloadMap.Clear()
t.mountNewDownloads()
case <-t.RemountTrigger:
t.DownloadMap.Clear()
t.mountNewDownloads()
}
}