summaryrefslogtreecommitdiff
path: root/system/db/init.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-18 13:56:22 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-18 13:56:22 -0700
commitaef933f144a89e947d8ccdae8e085eed221e2bdd (patch)
treeb42cb96fae1a07ee9b494e059988dd8bd617b0e5 /system/db/init.go
parentaf2f86df243709bc46ba079eb78aabc15b20866d (diff)
implement Sort on all content types by Timestamp, DESC (latest to oldest) - run in goroutine on db.Init() as well as any time content is saved via SetContent
Diffstat (limited to 'system/db/init.go')
-rw-r--r--system/db/init.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/system/db/init.go b/system/db/init.go
index d035510..5806622 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -33,8 +33,6 @@ func Init() {
if err != nil {
return err
}
-
- go SortContent(t + "_sorted")
}
// init db with other buckets as needed
@@ -72,6 +70,11 @@ func Init() {
log.Fatal("Coudn't initialize db with buckets.", err)
}
+ // sort all content into type_sorted buckets
+ for t := range content.Types {
+ go SortContent(t + "_sorted")
+ }
+
}
// SystemInitComplete checks if there is at least 1 admin user in the db which