|
|
|
@ -204,6 +204,13 @@ func populateIssueIndexer() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, repo := range repos { |
|
|
|
|
UpdateRepoIndexer(repo) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UpdateRepoIndexer add/update all issues of the repositories
|
|
|
|
|
func UpdateRepoIndexer(repo *models.Repository) { |
|
|
|
|
is, err := models.Issues(&models.IssuesOptions{ |
|
|
|
|
RepoIDs: []int64{repo.ID}, |
|
|
|
|
IsClosed: util.OptionalBoolNone, |
|
|
|
@ -211,18 +218,16 @@ func populateIssueIndexer() { |
|
|
|
|
}) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("Issues: %v", err) |
|
|
|
|
continue |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if err = models.IssueList(is).LoadDiscussComments(); err != nil { |
|
|
|
|
log.Error("LoadComments: %v", err) |
|
|
|
|
continue |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
for _, issue := range is { |
|
|
|
|
UpdateIssueIndexer(issue) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UpdateIssueIndexer add/update an issue to the issue indexer
|
|
|
|
|
func UpdateIssueIndexer(issue *models.Issue) { |
|
|
|
|