summary refs log tree commit diff stats
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/init.go b/init.go
index 639a78b..97a998c 100644
--- a/init.go
+++ b/init.go
@@ -214,7 +214,9 @@ func initTemplates() *template.Template {
 
 // Pull DB data into cache, if available.
 func initDatabase() {
+	confObj.mu.RLock()
 	db, err := leveldb.OpenFile(confObj.dbPath, nil)
+	confObj.mu.RUnlock()
 	if err != nil {
 		log.Fatalf("%v\n", err)
 	}