feat(model): enhance LoadFeed with timeout support and add tests

This commit is contained in:
2025-04-11 17:05:55 +08:00
parent 5fd117b1d1
commit 4cc6941d95
5 changed files with 114 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"time"
"gitea.malaihome.work/ans/podcast-search-go/model"
"gitea.malaihome.work/ans/podcast-search-go/search"
@@ -24,7 +25,7 @@ func main() {
fmt.Printf("name: %s, feedUrl: %s\n", item.CollectionName, item.FeedURL)
feedUrl := "http://www.ximalaya.com/album/19206382.xml"
pod, err := model.LoadFeed(feedUrl)
pod, err := model.LoadFeed(feedUrl, 5*time.Second)
if err != nil {
panic(err)
}