mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(feeds): process RSS on initial run (#918)
This commit is contained in:
parent
b0b98b8d9c
commit
01a69c7582
1 changed files with 2 additions and 11 deletions
|
@ -227,12 +227,6 @@ func (j *RSSJob) getFeed(ctx context.Context) (items []*gofeed.Item, err error)
|
|||
|
||||
//sort.Sort(feed)
|
||||
|
||||
bucketCount, err := j.CacheRepo.GetCountByBucket(ctx, bucketKey)
|
||||
if err != nil {
|
||||
j.Log.Error().Err(err).Msg("could not check if item exists")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// set ttl to 1 month
|
||||
ttl := time.Now().AddDate(0, 1, 0)
|
||||
|
||||
|
@ -264,12 +258,9 @@ func (j *RSSJob) getFeed(ctx context.Context) (items []*gofeed.Item, err error)
|
|||
continue
|
||||
}
|
||||
|
||||
// first time we fetch the feed the cached bucket count will be 0
|
||||
// only append to items if it's bigger than 0, so we get new items only
|
||||
if bucketCount > 0 {
|
||||
// only append if we successfully added to cache
|
||||
items = append(items, item)
|
||||
}
|
||||
}
|
||||
|
||||
// send to filters
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue