appview/indexer: handle NewIssueClosed #695

merged
opened by boltless.me targeting master from boltless.me/core: feat/search

Doesn't suport issue reopen yet

Signed-off-by: Seongmin Lee git@boltless.me

Changed files
+9
appview
indexer
+9
appview/indexer/notifier.go
··· 19 } 20 } 21 22 func (ix *Indexer) DeleteIssue(ctx context.Context, issue *models.Issue) { 23 l := log.FromContext(ctx).With("notifier", "indexer.DeleteIssue", "issue", issue) 24 l.Debug("deleting an issue")
··· 19 } 20 } 21 22 + func (ix *Indexer) NewIssueClosed(ctx context.Context, issue *models.Issue) { 23 + l := log.FromContext(ctx).With("notifier", "indexer.NewIssueClosed", "issue", issue) 24 + l.Debug("updating an issue") 25 + err := ix.Issues.Index(ctx, *issue) 26 + if err != nil { 27 + l.Error("failed to index an issue", "err", err) 28 + } 29 + } 30 + 31 func (ix *Indexer) DeleteIssue(ctx context.Context, issue *models.Issue) { 32 l := log.FromContext(ctx).With("notifier", "indexer.DeleteIssue", "issue", issue) 33 l.Debug("deleting an issue")