Skip to content

Commit 3144fc2

Browse files
author
Boris
committed
v0.1.4 - bug fixes
1 parent 279c2d0 commit 3144fc2

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

modules/router/r.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,35 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
249249
log.Println(remoteIP, "\t", r.Method, "\t", r.URL.Path, "\t", request.Action, "\t", 500, "\t", err.Error(), "\t", r.UserAgent())
250250
return
251251
}
252+
252253
var snap_list snapList
253254
_ = json.Unmarshal(response, &snap_list)
254255

255256
if !rt.conf.Elastic.Include {
256-
for i := 0; i < (len(snap_list) - 1); i++ {
257-
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list[i].Id)
257+
/*for i := 0; i < (len(snap_list_pre) - 1); i++ {
258+
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list_pre[i].Id)
258259
if err != nil {
259-
log.Println("Regex error for ", snap_list[i].Id)
260+
log.Println("Regex error for ", snap_list_pre[i].Id)
260261
}
261262
if matched {
262-
snap_list = remove(snap_list, i)
263+
snap_list = remove(snap_list_pre, i)
264+
}
265+
}*/
266+
267+
j := 0
268+
for _, n := range snap_list {
269+
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list[j].Id)
270+
if err != nil {
271+
log.Println("Regex error for ", snap_list[j].Id)
263272
}
273+
if !matched {
274+
snap_list[j] = n
275+
j++
276+
}
277+
264278
}
279+
snap_list = snap_list[:j]
280+
265281
}
266282
if request.Values.OrderType == "time" {
267283

modules/version/v.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
package version
1515

16-
var Version = "extractor/v0.1.3"
16+
var Version = "extractor/v0.1.4"

0 commit comments

Comments
 (0)