Signed-off-by: Seongmin Lee git@boltless.me
+4
appview/indexer/issues/indexer.go
+4
appview/indexer/issues/indexer.go
···
217
217
return batch.Flush()
218
218
}
219
219
220
+
func (ix *Indexer) Delete(ctx context.Context, issueId int64) error {
221
+
return ix.indexer.Delete(base36.Encode(issueId))
222
+
}
223
+
220
224
// Search searches for issues
221
225
func (ix *Indexer) Search(ctx context.Context, opts models.IssueSearchOptions) (*SearchResult, error) {
222
226
var queries []query.Query
+9
appview/indexer/notifier.go
+9
appview/indexer/notifier.go
···
18
18
l.Error("failed to index an issue", "err", err)
19
19
}
20
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")
25
+
err := ix.Issues.Delete(ctx, issue.Id)
26
+
if err != nil {
27
+
l.Error("failed to delete an issue", "err", err)
28
+
}
29
+
}
+2
appview/issues/issues.go
+2
appview/issues/issues.go
+4
appview/notify/db/db.go
+4
appview/notify/db/db.go
···
151
151
)
152
152
}
153
153
154
+
func (n *databaseNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {
155
+
// no-op for now
156
+
}
157
+
154
158
func (n *databaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {
155
159
actorDid := syntax.DID(follow.UserDid)
156
160
recipients := []syntax.DID{syntax.DID(follow.SubjectDid)}
+4
appview/notify/merged_notifier.go
+4
appview/notify/merged_notifier.go
···
60
60
m.fanout("NewIssueClosed", ctx, issue)
61
61
}
62
62
63
+
func (m *mergedNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {
64
+
m.fanout("DeleteIssue", ctx, issue)
65
+
}
66
+
63
67
func (m *mergedNotifier) NewFollow(ctx context.Context, follow *models.Follow) {
64
68
m.fanout("NewFollow", ctx, follow)
65
69
}
+2
appview/notify/notifier.go
+2
appview/notify/notifier.go
···
15
15
NewIssue(ctx context.Context, issue *models.Issue)
16
16
NewIssueComment(ctx context.Context, comment *models.IssueComment)
17
17
NewIssueClosed(ctx context.Context, issue *models.Issue)
18
+
DeleteIssue(ctx context.Context, issue *models.Issue)
18
19
19
20
NewFollow(ctx context.Context, follow *models.Follow)
20
21
DeleteFollow(ctx context.Context, follow *models.Follow)
···
44
45
func (m *BaseNotifier) NewIssue(ctx context.Context, issue *models.Issue) {}
45
46
func (m *BaseNotifier) NewIssueComment(ctx context.Context, comment *models.IssueComment) {}
46
47
func (m *BaseNotifier) NewIssueClosed(ctx context.Context, issue *models.Issue) {}
48
+
func (m *BaseNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {}
47
49
48
50
func (m *BaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {}
49
51
func (m *BaseNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {}