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)
ik.com> 2019-10-19 18:49:40 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-10-19 18:49:40 -0700 5707' href='/akkartik/mu/commit/html/apps/factorial2.subx.html?h=hlt&id=c8998b51e1995c307ddf831bff65309d57c25386'>c8998b51 ^
ec73ed12 ^

c8998b51 ^
ec73ed12 ^
c8998b51 ^





6070c23e ^
c8998b51 ^





ec73ed12 ^
c8998b51 ^

cea97b7b ^

6070c23e ^
c8998b51 ^


ec73ed12 ^
c8998b51 ^






86351aaf ^
c8998b51 ^




86351aaf ^












































ec73ed12 ^
86351aaf ^



c83dca9c ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181