Add golangci (#6418)

This commit is contained in:
kolaente 2019-06-12 21:41:28 +02:00 committed by techknowlogick
parent 5832f8d90d
commit f9ec2f89f2
147 changed files with 1046 additions and 774 deletions

View file

@ -101,7 +101,12 @@ func InitIssueIndexer(syncReindex bool) error {
return fmt.Errorf("Unsupported indexer queue type: %v", setting.Indexer.IssueQueueType)
}
go issueIndexerQueue.Run()
go func() {
err = issueIndexerQueue.Run()
if err != nil {
log.Error("issueIndexerQueue.Run: %v", err)
}
}()
if populate {
if syncReindex {
@ -161,7 +166,7 @@ func UpdateIssueIndexer(issue *models.Issue) {
comments = append(comments, comment.Content)
}
}
issueIndexerQueue.Push(&IndexerData{
_ = issueIndexerQueue.Push(&IndexerData{
ID: issue.ID,
RepoID: issue.RepoID,
Title: issue.Title,
@ -179,11 +184,11 @@ func DeleteRepoIssueIndexer(repo *models.Repository) {
return
}
if len(ids) <= 0 {
if len(ids) == 0 {
return
}
issueIndexerQueue.Push(&IndexerData{
_ = issueIndexerQueue.Push(&IndexerData{
IDs: ids,
IsDelete: true,
})