summaryrefslogtreecommitdiff
path: root/system/db/init.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-06-10 15:53:39 -0700
committerGitHub <noreply@github.com>2017-06-10 15:53:39 -0700
commit9361ebeb84297c02cfa3d9a3b784893b4e9f405e (patch)
tree72a8557eb7e717b930d2a3ff304a77f4ddff437d /system/db/init.go
parentccfbb7cb00113bf9b9c7e7ac5742df72cd5b96fd (diff)
Revert "Fix for search not working when addons are enabled"
Diffstat (limited to 'system/db/init.go')
-rw-r--r--system/db/init.go23
1 files changed, 9 insertions, 14 deletions
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