Skip to content

Commit

Permalink
rss: alter cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
l3uddz committed Feb 20, 2021
1 parent c2b98de commit 523e561
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rss/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ func (j *rssJob) getFeed() ([]media.FeedItem, error) {
}

// guid seen before?
cacheKey := fmt.Sprintf("%s_%s", j.name, i.GUID)
if cacheValue, err := j.cache.Get(j.name, cacheKey); err == nil {
if cacheValue, err := j.cache.Get(j.name, i.GUID); err == nil {
if string(cacheValue) == j.cacheFiltersHash {
// item has been seen before and the filters have not changed
continue
Expand Down Expand Up @@ -120,7 +119,7 @@ func (j *rssJob) getFeed() ([]media.FeedItem, error) {
items = append(items, b.Channel.Items[p])

// add item to temp cache (to prevent re-processing)
if err := j.cache.Put(j.name, cacheKey, []byte(j.cacheFiltersHash), j.cacheDuration); err != nil {
if err := j.cache.Put(j.name, i.GUID, []byte(j.cacheFiltersHash), j.cacheDuration); err != nil {
j.log.Error().
Err(err).
Str("guid", i.GUID).
Expand Down

0 comments on commit 523e561

Please sign in to comment.