Wrap up file downloading feature

This commit is contained in:
Mukhtar Akere
2024-09-22 16:28:31 +01:00
parent ba147ac56c
commit ff74e279d9
12 changed files with 94 additions and 133 deletions

View File

@@ -20,17 +20,15 @@ func (q *QBit) StartRefreshWorker(ctx context.Context) {
q.logger.Println("Qbit Refresh Worker stopped")
return
case <-refreshTicker.C:
q.RefreshArrs()
torrents := q.storage.GetAll("", "", nil)
if len(torrents) > 0 {
q.RefreshArrs()
}
}
}
}
func (q *QBit) RefreshArrs() {
torrents := q.storage.GetAll("", "", nil)
if len(torrents) == 0 {
return
}
q.arrs.Range(func(key, value interface{}) bool {
host, ok := key.(string)
token, ok2 := value.(string)