Skip to content

Commit

Permalink
Don't try to index posts with invalid timestamps, an empty timestamp …
Browse files Browse the repository at this point in the history
…violates our ES schema
  • Loading branch information
ericvolp12 committed Sep 22, 2023
1 parent c3b2c45 commit 8911ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion search/indexing.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *Server) indexPost(ctx context.Context, ident *identity.Identity, rec *a
_, err := util.ParseTimestamp(rec.CreatedAt)
if err != nil {
log.Warn("post had invalid timestamp", "createdAt", rec.CreatedAt, "parseErr", err)
rec.CreatedAt = ""
return fmt.Errorf("post had invalid timestamp: %w", err)
}

doc := TransformPost(rec, ident, rkey, rcid.String())
Expand Down

0 comments on commit 8911ead

Please sign in to comment.