From 9361ebeb84297c02cfa3d9a3b784893b4e9f405e Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 10 Jun 2017 15:53:39 -0700 Subject: Revert "Fix for search not working when addons are enabled" --- system/db/init.go | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'system') diff --git a/system/db/init.go b/system/db/init.go index ad0011f..a401a2a 100644 --- a/system/db/init.go +++ b/system/db/init.go @@ -85,22 +85,17 @@ func Init() { 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 + } -// 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 -// 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() { - for t := range item.Types { - err := search.MapIndex(t) - if err != nil { - log.Fatalln(err) - return + SortContent(t) } - SortContent(t) - } + }() } // SystemInitComplete checks if there is at least 1 admin user in the db which -- cgit v1.2.3