Skip to content

Commit

Permalink
fix: remove locked subject from search
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 14, 2024
1 parent d7b4b16 commit faa390c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/search/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ func (c *client) OnSubjectUpdate(ctx context.Context, id model.SubjectID) error
s, err := c.subjectRepo.Get(ctx, id, subject.Filter{})
if err != nil {
if errors.Is(err, gerr.ErrNotFound) {
return c.DeleteSubject(ctx, id)
return nil
}
return errgo.Wrap(err, "subjectRepo.Get")
}

if s.Redirect != 0 {
if s.Redirect != 0 || s.Ban != 0 {
return c.DeleteSubject(ctx, id)
}

Expand All @@ -178,6 +178,9 @@ func (c *client) OnSubjectDelete(_ context.Context, id model.SubjectID) error {
return errgo.Wrap(err, "search")
}

func (c *client) flush() {

Check failure on line 181 in internal/search/client.go

View workflow job for this annotation

GitHub Actions / lint

func `(*client).flush` is unused (unused)
}

// UpsertSubject add subject to search backend.
func (c *client) sendBatch(items []subjectIndex) {
c.log.Debug("send batch to meilisearch", zap.Int("len", len(items)))
Expand Down

0 comments on commit faa390c

Please sign in to comment.