Skip to content

Commit

Permalink
fix(subscribe): avoid push old contents
Browse files Browse the repository at this point in the history
  • Loading branch information
indes committed Jul 14, 2019
1 parent 7a068ea commit 7d16009
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model/source.go
Expand Up @@ -23,6 +23,8 @@ func (s *Source) appendContents(items []*rss.Item) error {
c, _ := getContentByFeedItem(s, item)
s.Content = append(s.Content, c)
}
// 开启task更新
s.ErrorCount = 0
db.Save(&s)
return nil
}
Expand Down Expand Up @@ -53,7 +55,8 @@ func FindOrNewSourceByUrl(url string) (*Source, error) {
}

source.Title = feed.Title
source.ErrorCount = 0
// 避免task更新
source.ErrorCount = 101

// Get contents and insert
items := feed.Items
Expand Down

0 comments on commit 7d16009

Please sign in to comment.