Files
decypharr/pkg/debrid/debrid/worker.go
Mukhtar Akere face86e151 - Cleanup webdav
- Include a re-insert fature for botched torrents
- Other minor bug fixes
2025-03-31 06:11:04 +01:00

35 lines
642 B
Go

package debrid
import "time"
func (c *Cache) Refresh() error {
// For now, we just want to refresh the listing and download links
go c.refreshDownloadLinksWorker()
go c.refreshTorrentsWorker()
return nil
}
func (c *Cache) refreshDownloadLinksWorker() {
refreshTicker := time.NewTicker(c.downloadLinksRefreshInterval)
defer refreshTicker.Stop()
for {
select {
case <-refreshTicker.C:
c.refreshDownloadLinks()
}
}
}
func (c *Cache) refreshTorrentsWorker() {
refreshTicker := time.NewTicker(c.torrentRefreshInterval)
defer refreshTicker.Stop()
for {
select {
case <-refreshTicker.C:
c.refreshTorrents()
}
}
}