Skip to content

Commit

Permalink
worker: fix updated time
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcmrlchtdj committed Nov 3, 2024
1 parent 1477599 commit ec8f6be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ func parseFeed(ctx context.Context, done *sync.WaitGroup, qFeedFetched <-chan *f

qFeedParsed := make(chan *feedItem)

now := time.Now()
worker := func(feed *feedItem) {
updated := getLatestUpdated(feed.fetched)
if updated == nil {
err := errors.WithMessage(errors.New("can't parse date field"), feed.feed.URL)
logger.Warn().Str("module", "worker").Stack().Err(err).Send()
now := time.Now()
updated = &now
}
if updated.Compare(now) > 0 {
updated = &now
}

Expand Down

0 comments on commit ec8f6be

Please sign in to comment.