diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-13 13:13:07 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-13 13:13:07 -0800 |
commit | ffa8654af317bfb05b1d38a17aa4a972d1c8056d (patch) | |
tree | 3f434769aab44f1437f5438eae9942871f98950b /system/db/init.go | |
parent | 59ee9fbb237673c2d0cccad42f7adbae65852b8d (diff) |
adding more precise timestamp creation algorithm, and a LoadCacheConfig func to warm the config cache vs. trying to set defaults on init so the cache exists
Diffstat (limited to 'system/db/init.go')
-rw-r--r-- | system/db/init.go | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/system/db/init.go b/system/db/init.go index 98ba056..769137d 100644 --- a/system/db/init.go +++ b/system/db/init.go @@ -1,10 +1,8 @@ package db import ( - "encoding/json" "log" - "github.com/ponzu-cms/ponzu/system/admin/config" "github.com/ponzu-cms/ponzu/system/item" "github.com/boltdb/bolt" @@ -57,18 +55,9 @@ func Init() { } } - // seed db with configs structure if not present - b := tx.Bucket([]byte("__config")) - if b.Get([]byte("settings")) == nil { - j, err := json.Marshal(&config.Config{}) - if err != nil { - return err - } - - err = b.Put([]byte("settings"), j) - if err != nil { - return err - } + err := LoadCacheConfig() + if err != nil { + return err } clientSecret := ConfigCache("client_secret").(string) |