diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-28 17:06:04 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-28 17:06:04 -0700 |
commit | c716fb39d8ae2e3d3d767c1419997d2a529329a7 (patch) | |
tree | d54ecf39d4b78d52b8c4d1d5185ebfa2bc7e4c66 | |
parent | 763a6f96821be3c6fc3874f3fd9a5bd0316b2bf4 (diff) |
code reorg and debugging bolt issues
-rw-r--r-- | system/api/analytics/init.go (renamed from system/api/analytics/analytics.go) | 6 | ||||
-rw-r--r-- | system/db/init.go | 16 |
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) + } + }() } |