Skip to content

Commit

Permalink
chore(feeds): remove posts without an email
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jan 10, 2025
1 parent 4a540a6 commit 8283fa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions feeds/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ func (f *Fetcher) RunPost(logger *slog.Logger, user *db.User, post *db.Post) err

parsed := shared.ListParseText(post.Text)

if parsed.Email == "" {
logger.Error("post does not have an email associated, removing post")
err := f.db.RemovePosts([]string{post.ID})
if err != nil {
return err
}
}

logger.Info("last digest at", "lastDigest", post.Data.LastDigest.Format(time.RFC3339))
err := f.Validate(post, parsed)
if err != nil {
Expand Down

0 comments on commit 8283fa1

Please sign in to comment.