summaryrefslogtreecommitdiff
path: root/system/db/init.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2017-01-12 16:19:00 -0800
committerGitHub <noreply@github.com>2017-01-12 16:19:00 -0800
commit21b9f301c5e1305c3be4e260161d2495bca059de (patch)
tree3be88e282bb9801b5b0354f89c5fe127996b0b6a /system/db/init.go
parentad96d5fa100615ada7ae8f06e75088f9297122fd (diff)
[addons] Expanding basic addon framework (#29)
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 bf93bc6..eaf6d76 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -24,6 +24,10 @@ func Close() {
// Init creates a db connection, initializes db with required info, sets secrets
func Init() {
+ if store != nil {
+ return
+ }
+
var err error
store, err = bolt.Open("system.db", 0666, nil)
if err != nil {
@@ -45,7 +49,7 @@ func Init() {
}
// init db with other buckets as needed
- buckets := []string{"__config", "__users", "__contentIndex"}
+ buckets := []string{"__config", "__users", "__contentIndex", "__addons"}
for _, name := range buckets {
_, err := tx.CreateBucketIfNotExists([]byte(name))
if err != nil {
@@ -90,7 +94,6 @@ func Init() {
SortContent(t)
}
}()
-
}
// SystemInitComplete checks if there is at least 1 admin user in the db which