summary refs log tree commit diff stats
path: root/main.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 /main.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 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index 448ff1a..9c4a4ab 100644
--- a/main.go
+++ b/main.go
@@ -10,8 +10,6 @@ import (
 	"github.com/gorilla/mux"
 )
 
-const getwtxt = "0.1"
-
 func main() {
 
 	// StrictSlash(true) allows /api and /api/
@@ -69,7 +67,9 @@ func main() {
 		HandlerFunc(apiTagsHandler)
 
 	// format the port for the http.Server object
+	confObj.mu.RLock()
 	portnum := fmt.Sprintf(":%v", confObj.port)
+	confObj.mu.RUnlock()
 	// defines options for the http server.
 	// handlers.CompressHandler gzips all responses.
 	// Write/Read timeouts are self explanatory.
@@ -80,7 +80,7 @@ func main() {
 		ReadTimeout:  15 * time.Second,
 	}
 
-	log.Printf("Listening on port %v\n", confObj.port)
+	log.Printf("Listening on %v\n", portnum)
 	err := server.ListenAndServe()
 	if err != nil {
 		log.Printf("%v\n", err)