Fix
This commit is contained in:
parent
7b9473f6fc
commit
a0afd43471
26
http.go
26
http.go
|
@ -19,21 +19,23 @@ func Serve() {
|
|||
|
||||
hookHandler := func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println("Fetch feeds: ", time.Now().Format(time.RFC3339))
|
||||
for _, actor := range actors {
|
||||
fmt.Println(actor.feed)
|
||||
articles, err := allFeedItems(actor.feed)
|
||||
if err != nil {
|
||||
fmt.Println(actor.feed, err.Error())
|
||||
continue
|
||||
}
|
||||
// Post or update latest 5 article
|
||||
for _, article := range (*articles)[0:int(math.Min(float64(len(*articles)-1), 4))] {
|
||||
err = actor.PostArticle(article)
|
||||
go func() {
|
||||
for _, actor := range actors {
|
||||
fmt.Println(actor.feed)
|
||||
articles, err := allFeedItems(actor.feed)
|
||||
if err != nil {
|
||||
fmt.Println("Posting", article, "failed")
|
||||
fmt.Println(actor.feed, err.Error())
|
||||
continue
|
||||
}
|
||||
// Post or update latest 5 article
|
||||
for _, article := range (*articles)[0:int(math.Min(float64(len(*articles)-1), 4))] {
|
||||
err = actor.PostArticle(article)
|
||||
if err != nil {
|
||||
fmt.Println("Posting", article, "failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
webfingerHandler := func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Reference in New Issue