Skip to content

Commit

Permalink
v0.1.4 - bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Dec 2, 2020
1 parent 279c2d0 commit 3144fc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions modules/router/r.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,35 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
log.Println(remoteIP, "\t", r.Method, "\t", r.URL.Path, "\t", request.Action, "\t", 500, "\t", err.Error(), "\t", r.UserAgent())
return
}

var snap_list snapList
_ = json.Unmarshal(response, &snap_list)

if !rt.conf.Elastic.Include {
for i := 0; i < (len(snap_list) - 1); i++ {
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list[i].Id)
/*for i := 0; i < (len(snap_list_pre) - 1); i++ {
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list_pre[i].Id)
if err != nil {
log.Println("Regex error for ", snap_list[i].Id)
log.Println("Regex error for ", snap_list_pre[i].Id)
}
if matched {
snap_list = remove(snap_list, i)
snap_list = remove(snap_list_pre, i)
}
}*/

j := 0
for _, n := range snap_list {
matched, err := regexp.MatchString(`^[\.]\S+`, snap_list[j].Id)
if err != nil {
log.Println("Regex error for ", snap_list[j].Id)
}
if !matched {
snap_list[j] = n
j++
}

}
snap_list = snap_list[:j]

}
if request.Values.OrderType == "time" {

Expand Down
2 changes: 1 addition & 1 deletion modules/version/v.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

package version

var Version = "extractor/v0.1.3"
var Version = "extractor/v0.1.4"

0 comments on commit 3144fc2

Please sign in to comment.