summary refs log tree commit diff stats
path: root/handlers.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-20 23:01:13 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-21 03:42:18 -0400
commitbd23ef0959496aba4c6fc8ca2b3969bbf17aa9d5 (patch)
tree7b388de8cdf89b6c1db180122678f5559aacdf9a /handlers.go
parentdf1d1efa19aed5bc6553c7c0a0b4b7dfe20e3bd0 (diff)
downloadgetwtxt-bd23ef0959496aba4c6fc8ca2b3969bbf17aa9d5.tar.gz
added cache update / db push intervals to conf;
made confObj concurrency-safe via sync.RWMutex;
new config values related to db/cache
Diffstat (limited to 'handlers.go')
-rw-r--r--handlers.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/handlers.go b/handlers.go
index 4ec511d..151eb60 100644
--- a/handlers.go
+++ b/handlers.go
@@ -30,7 +30,9 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
 
 	// Pass the confObj.Instance data to the template,
 	// then send it to the client.
+	confObj.mu.RLock()
 	err := tmpls.ExecuteTemplate(w, "index.html", confObj.Instance)
+	confObj.mu.RUnlock()
 	if err != nil {
 		log500(w, r, err)
 		return