diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-10 14:01:24 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-10 14:01:24 -0800 |
commit | f2908a6b3a602394385c7b5bf5014085361549da (patch) | |
tree | 6fc71d8e3e185268814aca4bf12193282c586a41 /system/db/init.go | |
parent | 3cc514f8d3a58e01ddc6f19fe39c434a91ac501e (diff) |
adding test for store value before attempt to open db
Diffstat (limited to 'system/db/init.go')
-rw-r--r-- | system/db/init.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/system/db/init.go b/system/db/init.go index 3d49212..ff2926c 100644 --- a/system/db/init.go +++ b/system/db/init.go @@ -26,6 +26,11 @@ func Close() { // Init creates a db connection, initializes db with required info, sets secrets func Init() { fmt.Println("db.Init inside db package") + if store != nil { + fmt.Println("db.Init already intialized store") + return + } + var err error store, err = bolt.Open("system.db", 0666, nil) if err != nil { |