- killfile stats: incremented only when adding a new domain in BL

- Malformed lines stats: stats are reset at refresh; ignoring blank/comment lines
remotes/1680050961956510080/tmp_refs/heads/master
bloved 2021-01-12 13:35:36 +01:00
parent b6dfee64a6
commit 5e94032cd0
3 changed files with 21 additions and 2 deletions

View File

@ -26,11 +26,18 @@ func bWriteThread() {
for item := range bChannel { for item := range bChannel {
alreadyInSomeDB := false
for _, config := range item.Kconfigs { for _, config := range item.Kconfigs {
if !alreadyInSomeDB {
alreadyInSomeDB = domainInKillfile(item.Kdomain, config)
}
writeInKillfile(item.Kdomain, item.Ksource, config) writeInKillfile(item.Kdomain, item.Ksource, config)
} }
incrementStats("BL domains from "+item.Ksource, 1) if !alreadyInSomeDB {
incrementStats("TOTAL", 1) incrementStats("BL domains from "+item.Ksource, 1)
incrementStats("TOTAL", 1)
}
} }

View File

@ -20,6 +20,9 @@ func DoubleIndexFilter(durl string, configs stringarray) error {
fmt.Println("DoubleIndexFilter: Retrieving HostFile from: ", durl) fmt.Println("DoubleIndexFilter: Retrieving HostFile from: ", durl)
// resets malformed HostLines for url
setstatsvalue("Malformed HostLines "+durl, 0)
var err error var err error
// Get the data // Get the data
@ -48,6 +51,9 @@ func DoubleIndexFilter(durl string, configs stringarray) error {
line := scanner.Text() line := scanner.Text()
if len(line) == 0 || strings.TrimSpace(line)[0] == '#' {
continue
}
h := strings.FieldsFunc(line, splitter) h := strings.FieldsFunc(line, splitter)
if h == nil { if h == nil {

View File

@ -18,6 +18,9 @@ func SingleIndexFilter(durl string, configs stringarray) error {
fmt.Println("Retrieving DomainFile from: ", durl) fmt.Println("Retrieving DomainFile from: ", durl)
// resets malformed HostLines for url
setstatsvalue("Malformed DomainLines "+durl, 0)
var err error var err error
// Get the data // Get the data
@ -46,6 +49,9 @@ func SingleIndexFilter(durl string, configs stringarray) error {
line := scanner.Text() line := scanner.Text()
if len(line) == 0 || strings.TrimSpace(line)[0] == '#' {
continue
}
h := strings.FieldsFunc(line, splitter) h := strings.FieldsFunc(line, splitter)
if h == nil { if h == nil {