stabilized zmq loop

This commit is contained in:
Paul 2023-01-19 08:51:03 +01:00
parent 1cfe9e83bb
commit 53f78abaf3

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"time"
"git.paulbsd.com/paulbsd/ipbl/src/config"
"git.paulbsd.com/paulbsd/ipbl/src/models"
@ -49,6 +50,7 @@ func Handle(cfg *config.Config, reqsock *goczmq.Sock, pubsock *goczmq.Sock, chan
err = json.Unmarshal(val, &apievent)
if err != nil {
log.Println("unable to parse ip address", err)
time.Sleep(time.Second)
continue
}
if apievent.IPData.IP != "" && apievent.IPData.IP == lastip {