feat(model): enhance LoadFeed with timeout support and add tests
This commit is contained in:
3
main.go
3
main.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user