chg: fix: do not cache empty results
This commit is contained in:
@@ -78,6 +78,11 @@ func (i *Indexer) HandlerStarckFilmesIndexer(w http.ResponseWriter, r *http.Requ
|
||||
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 getTorrentStarckFilmes(ctx, i, link)
|
||||
|
||||
Reference in New Issue
Block a user