updated ipbl limit on ScanIP
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2022-04-10 19:11:26 +02:00
parent c362158dfb
commit 632c4ba101

View File

@ -104,7 +104,7 @@ func InsertIPBulk(cfg *config.Config, ips *[]IP) (numinsert int64, numupdate int
func ScanIP(cfg *config.Config) (err error) { func ScanIP(cfg *config.Config) (err error) {
for { for {
orphans := []IP{} orphans := []IP{}
if cfg.Db.Where("rdns IS NULL").Asc("ip").Find(&orphans); len(orphans) > 0 { if cfg.Db.Where("rdns IS NULL").Asc("ip").Limit(500).Find(&orphans); len(orphans) > 0 {
for _, i := range orphans { for _, i := range orphans {
reverse, _ := i.UpdateRDNS() reverse, _ := i.UpdateRDNS()
log.Printf("%s -> \"%s\"\n", i.IP, reverse) log.Printf("%s -> \"%s\"\n", i.IP, reverse)