Skip to content

Commit

Permalink
Merge pull request #164 from ponzu-cms/ponzu-dev
Browse files Browse the repository at this point in the history
[core] remove code duplication from InitSearchIndex commit
  • Loading branch information
nilslice authored Jun 14, 2017
2 parents 81e1682 + 6b1f2a6 commit f4c5d79
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions system/db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,11 @@ func Init() {
if err != nil {
log.Fatalln("Failed to invalidate cache.", err)
}

go func() {
for t := range item.Types {
err := search.MapIndex(t)
if err != nil {
log.Fatalln(err)
return
}

SortContent(t)
}
}()
}

// InitSearchIndex initializes Search Index for search to be functional
// This was moved out of db.Init and put to main(), because addon checker was initializing db together with
// search indexing initialisation in time when there were no item.Types defined so search index was always
// search indexing initialisation in time when there were no item.Types defined so search index was always
// empty when using addons. We still have no guarentee whatsoever that item.Types is defined
// Should be called from a goroutine after SetContent is successful (SortContent requirement)
func InitSearchIndex() {
Expand Down

0 comments on commit f4c5d79

Please sign in to comment.