From f2908a6b3a602394385c7b5bf5014085361549da Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 10 Jan 2017 14:01:24 -0800 Subject: adding test for store value before attempt to open db --- system/db/init.go | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- cgit v1.2.3