summary refs log tree commit diff stats
path: root/cache.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-21 18:49:43 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-21 18:59:56 -0400
commit4f0847bb24a5df77f88c883461491a2f6fd955d7 (patch)
tree0f9e2eef1f6bfa4f3a09370730ad8351c1ce24dd /cache.go
parent61e81ea7acfc01e8b7ea33156a36c15b0674c79f (diff)
downloadgetwtxt-4f0847bb24a5df77f88c883461491a2f6fd955d7.tar.gz
runtime bugs related to api output
Diffstat (limited to 'cache.go')
-rw-r--r--cache.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cache.go b/cache.go
index be3d7d3..6220b26 100644
--- a/cache.go
+++ b/cache.go
@@ -78,11 +78,11 @@ func pushDatabase() error {
 	// be done at one time rather than
 	// per entry.
 	twtxtCache.Mu.RLock()
-	var dbBasket *leveldb.Batch
+	var dbBasket = &leveldb.Batch{}
 	for k, v := range twtxtCache.Reg {
 		dbBasket.Put([]byte(k+"*Nick"), []byte(v.Nick))
 		dbBasket.Put([]byte(k+"*URL"), []byte(v.URL))
-		dbBasket.Put([]byte(k+"*IP"), []byte(v.IP))
+		dbBasket.Put([]byte(k+"*IP"), []byte(v.IP.String()))
 		dbBasket.Put([]byte(k+"*Date"), []byte(v.Date))
 		for i, e := range v.Status {
 			rfc := i.Format(time.RFC3339)
@@ -151,7 +151,7 @@ func pullDatabase() {
 			for i := 0; i < ref.NumField(); i++ {
 
 				f := ref.Field(i)
-				if f.String() == field {
+				if strings.Contains(f.String(), field) {
 					f.Set(reflect.ValueOf(val))
 					break
 				}
@@ -161,7 +161,7 @@ func pullDatabase() {
 			// If we're looking at a Status entry in the DB,
 			// parse the time then add it to the TimeMap under
 			// data.Status
-			thetime, err := time.Parse("RFC3339", split[2])
+			thetime, err := time.Parse(time.RFC3339, split[2])
 			if err != nil {
 				log.Printf("%v\n", err)
 			}
1:04:45 +0000 Reduced screen flicker, and fixed end page' href='/danisanti/profani-tty/commit/title_bar.c?id=54c43b613c74873e05f40deff102f8b03c6a9c6f'>54c43b61 ^
dd9f6f82 ^
c8bf654e ^
dd9f6f82 ^

ea261b88 ^
279737ba ^

c8bf654e ^
6b1b035d ^
c8bf654e ^

7344a68f ^
355f2a68 ^
dd9f6f82 ^
54c43b61 ^
355f2a68 ^

279737ba ^

355f2a68 ^
d9c47c9b ^

6e24995e ^
54c43b61 ^
c8bf654e ^
4148f053 ^
279737ba ^

53130f0e ^
6b1b035d ^
53130f0e ^
6f69ce26 ^
7344a68f ^
6f69ce26 ^
53130f0e ^




279737ba ^

632528a9 ^
d9c47c9b ^





6bad38c2 ^
d9c47c9b ^







6bad38c2 ^
d9c47c9b ^




54c43b61 ^




632528a9 ^

279737ba ^

4148f053 ^
2a22ec92 ^




ea261b88 ^


279737ba ^

ea261b88 ^
dd9f6f82 ^

4148f053 ^

d9c47c9b ^




6bad38c2 ^
d9c47c9b ^































6bad38c2 ^
d9c47c9b ^









279737ba ^
d9c47c9b ^
ea261b88 ^
6b1b035d ^
ea261b88 ^
7344a68f ^
ea261b88 ^
7344a68f ^
ea261b88 ^
dd9f6f82 ^
ea261b88 ^
dd9f6f82 ^

2fe5d3e9 ^





dd9f6f82 ^
ea261b88 ^
dd9f6f82 ^
6bad38c2 ^
7344a68f ^
ea261b88 ^
7344a68f ^
6bad38c2 ^
ea261b88 ^

dd9f6f82 ^
279737ba ^

dd9f6f82 ^





6bad38c2 ^
dd9f6f82 ^

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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211