summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-21 16:05:37 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-21 16:05:37 -0400
commitece8a01fb1ec9417c1fc433a665024cc52dbf183 (patch)
tree8cf1eefba62a187c8cdeab5d04908278a6a1e3a9
parentb29e1c163f3cc88037f301c1cc1d71c7707ee64f (diff)
downloadgetwtxt-ece8a01fb1ec9417c1fc433a665024cc52dbf183.tar.gz
missing mutex rlock for confobj
-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)
 	}
10' href='#n110'>110 111 112 113 114 115 116 117 118 119 120 121