chg: fix: do not cache empty results

This commit is contained in:
2025-07-30 14:16:06 +00:00
parent 4d6cfb8668
commit 3b9f49a9c0
6 changed files with 30 additions and 0 deletions

View File

@@ -81,6 +81,11 @@ func (i *Indexer) HandlerComandoHDsIndexer(w http.ResponseWriter, r *http.Reques
links = append(links, link)
})
// if no links were indexed, expire the document in cache
if len(links) == 0 {
i.requester.ExpireDocument(ctx, url)
}
// extract each torrent link
indexedTorrents := utils.ParallelFlatMap(links, func(link string) ([]schema.IndexedTorrent, error) {
return getTorrentsComandoHDs(ctx, i, link)