summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/api/analytics/init.go (renamed from system/api/analytics/analytics.go)6
-rw-r--r--system/db/init.go16
2 files changed, 14 insertions, 8 deletions
diff --git a/system/api/analytics/analytics.go b/system/api/analytics/init.go
index c30ce26..c04a7f2 100644
--- a/system/api/analytics/analytics.go
+++ b/system/api/analytics/init.go
@@ -4,6 +4,7 @@
package analytics
import (
+ "fmt"
"log"
"net/http"
"strings"
@@ -59,6 +60,8 @@ func Init() {
log.Fatalln(err)
}
+ fmt.Println("analytics", store)
+
recordChan = make(chan apiRequest, 1024*128)
go serve()
@@ -67,6 +70,9 @@ func Init() {
return nil
})
+ if err != nil {
+ log.Fatalln(err)
+ }
}
func serve() {
diff --git a/system/db/init.go b/system/db/init.go
index 7f8bce9..423c265 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -2,6 +2,7 @@ package db
import (
"encoding/json"
+ "fmt"
"log"
"github.com/bosssauce/ponzu/content"
@@ -29,6 +30,8 @@ func Init() {
log.Fatalln(err)
}
+ fmt.Println("system", store)
+
err = store.Update(func(tx *bolt.Tx) error {
// initialize db with all content type buckets & sorted bucket for type
for t := range content.Types {
@@ -78,14 +81,11 @@ func Init() {
log.Fatalln("Coudn't initialize db with buckets.", err)
}
- // sort all content into type_sorted buckets
- // if SystemInitComplete() {
- // go func() {
- // for t := range content.Types {
- // SortContent(t)
- // }
- // }()
- // }
+ go func() {
+ for t := range content.Types {
+ SortContent(t)
+ }
+ }()
}